|
||||||||||
| 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<com.itextpdf.text.Image> userAgent)
|
|
| Method Summary | |
|---|---|
com.itextpdf.text.Chunk |
createChunk(CSSInlineBox box)
Creates a chunk with the text and font specified by the given box. |
com.itextpdf.text.Chunk |
createChunk(CSSInlineBox box,
String text)
Creates a chunk with the text and font specified by the given box. |
com.itextpdf.text.Chunk |
createChunk(DownloadListener<com.itextpdf.text.Image> box)
Creates a chunk with an image. |
com.itextpdf.text.Font |
createFont(CSS2ComputedProperties styledecl)
Create an iText font from the properties specified in the given style. |
com.itextpdf.text.Phrase |
createPhrase(CSSInlineBox box)
Creates a Phrase object according to the style of an inline box. |
void |
formatChunk(CSS2ComputedProperties styledecl,
com.itextpdf.text.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,
com.itextpdf.text.Document pdf)
|
void |
formatList(CSSContainerBox box,
com.itextpdf.text.List list)
|
void |
formatListItem(CSSContainerBox box,
com.itextpdf.text.ListItem item)
|
void |
formatParagraph(CSSBox box,
com.itextpdf.text.Paragraph par)
Formats the given paragraph according to the style that applies to the given peer element. |
void |
formatPCell(CSSTableCellBox box,
com.itextpdf.text.pdf.PdfPCell cell)
Formats a PdfPCell according to the style that applies to the given peer element. |
void |
formatPTable(CSSContainerBox box,
com.itextpdf.text.pdf.PdfPTable table)
Formats a PdfPTable according to the style that applies to the given peer element. |
void |
formatRectangle(CSSBox box,
com.itextpdf.text.Rectangle rect)
|
StyleDatabase |
getStyleDatabase()
Gets the style database associated to this formatter. |
protected UserAgent<com.itextpdf.text.Image> |
getUserAgent()
|
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 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PDFStyleFormatter(UserAgent<com.itextpdf.text.Image> userAgent)
| Method Detail |
|---|
public StyleDatabase getStyleDatabase()
protected UserAgent<com.itextpdf.text.Image> getUserAgent()
public com.itextpdf.text.Font createFont(CSS2ComputedProperties styledecl)
throws com.itextpdf.text.DocumentException
styledecl - the style declaration.
com.itextpdf.text.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 com.itextpdf.text.Chunk createChunk(CSSInlineBox box)
box - the inline box.
public com.itextpdf.text.Chunk createChunk(CSSInlineBox box,
String text)
box - the inline box.
public com.itextpdf.text.Chunk createChunk(DownloadListener<com.itextpdf.text.Image> box)
box - the box containing an image.
public void formatChunk(CSS2ComputedProperties styledecl,
com.itextpdf.text.Chunk ch)
styledecl - the style applying to the chunk box.ch - the chunk to format.public com.itextpdf.text.Phrase createPhrase(CSSInlineBox box)
box - the inline box.
public void formatDocument(CSSBox box,
com.itextpdf.text.Document pdf)
public void formatRectangle(CSSBox box,
com.itextpdf.text.Rectangle rect)
public void formatParagraph(CSSBox box,
com.itextpdf.text.Paragraph par)
box - the box to be rendered.par - the paragraph to be formatted.
public void formatPTable(CSSContainerBox box,
com.itextpdf.text.pdf.PdfPTable table)
box - the box to be rendered.table - the table to be formatted.
public void formatPCell(CSSTableCellBox box,
com.itextpdf.text.pdf.PdfPCell cell)
box - the box to be rendered.cell - the cell to be formatted.
public void formatList(CSSContainerBox box,
com.itextpdf.text.List list)
public void formatListItem(CSSContainerBox box,
com.itextpdf.text.ListItem item)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||