|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectinfo.informatica.doc.pdf.itext.PDFStyleFormatter
public class PDFStyleFormatter
Utility class for helping in the format of iText PDF documents based on CSS style sheets.
TODO: work in progress.
| Constructor Summary | |
|---|---|
PDFStyleFormatter(UserAgent<Image> userAgent)
|
|
| Method Summary | |
|---|---|
Chunk |
createChunk(CSSInlineBox box)
Creates a chunk with the text and font specified by the given box. |
Chunk |
createChunk(CSSInlineBox box,
String text)
Creates a chunk with the text and font specified by the given box. |
Chunk |
createChunk(DownloadListener<Image> box)
Creates a chunk with an image. |
Font |
createFont(CSS2ComputedProperties styledecl)
Create an iText font from the properties specified in the given style. |
Phrase |
createPhrase(CSSInlineBox box)
Creates a Phrase object according to the style of an inline box. |
void |
formatChunk(CSS2ComputedProperties styledecl,
Chunk ch)
Creates a chunk with the given text and the font specified by the style applying to the given box. |
void |
formatDocument(CSSBox box,
Document pdf)
|
void |
formatList(CSSContainerBox box,
List list)
|
void |
formatListItem(CSSContainerBox box,
ListItem item)
|
void |
formatParagraph(CSSBox box,
Paragraph par)
Formats the given paragraph according to the style that applies to the given peer element. |
void |
formatPCell(CSSTableCellBox box,
PdfPCell cell)
Formats a PdfPCell according to the style that applies to the given peer element. |
void |
formatPTable(CSSContainerBox box,
PdfPTable table)
Formats a PdfPTable according to the style that applies to the given peer element. |
void |
formatRectangle(CSSBox box,
Rectangle rect)
|
StyleDatabase |
getStyleDatabase()
Gets the style database associated to this formatter. |
static int |
translateAlignment(String align)
Translates the alignment as provided by CSS/XHTML, to alignment as understood by the iText package. |
static int |
translateVerticalAlignment(String align)
Translates the vertical alignment as provided by CSS/XHTML, to same alignment as understood by the iText package. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PDFStyleFormatter(UserAgent<Image> userAgent)
| Method Detail |
|---|
public StyleDatabase getStyleDatabase()
public Font createFont(CSS2ComputedProperties styledecl)
throws DocumentException
styledecl - the style declaration.
DocumentExceptionpublic static int translateAlignment(String align)
align - a string with the alignment identifier (left, right, center,
justify).
com.itextpdf.text.Element.public static int translateVerticalAlignment(String align)
com.itextpdf.text.Element.public Chunk createChunk(CSSInlineBox box)
box - the inline box.
public Chunk createChunk(CSSInlineBox box,
String text)
box - the inline box.
public Chunk createChunk(DownloadListener<Image> box)
box - the box containing an image.
public void formatChunk(CSS2ComputedProperties styledecl,
Chunk ch)
styledecl - the style applying to the chunk box.ch - the chunk to format.public Phrase createPhrase(CSSInlineBox box)
box - the inline box.
public void formatDocument(CSSBox box,
Document pdf)
public void formatRectangle(CSSBox box,
Rectangle rect)
public void formatParagraph(CSSBox box,
Paragraph par)
box - the box to be rendered.par - the paragraph to be formatted.
public void formatPTable(CSSContainerBox box,
PdfPTable table)
box - the box to be rendered.table - the table to be formatted.
public void formatPCell(CSSTableCellBox box,
PdfPCell cell)
box - the box to be rendered.cell - the cell to be formatted.
public void formatList(CSSContainerBox box,
List list)
public void formatListItem(CSSContainerBox box,
ListItem item)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||