Class ITextRenderer
java.lang.Object
org.xhtmlrenderer.pdf.ITextRenderer
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate @Nullable Documentprivate final floatprivate @Nullable PDFCreationListenerprivate final ITextOutputDeviceprivate com.lowagie.text.Documentprivate @Nullable PDFEncryptionprivate @Nullable Characterprivate @Nullable Integerprivate @Nullable BlockBoxprivate final SharedContextprivate @Nullable com.lowagie.text.pdf.PdfWriterstatic final intstatic final floatprivate final char[] -
Constructor Summary
ConstructorsConstructorDescriptionITextRenderer(float dotsPerPoint, int dotsPerPixel) ITextRenderer(float dotsPerPoint, int dotsPerPixel, FontResolver fontResolver) ITextRenderer(float dotsPerPoint, int dotsPerPixel, ITextOutputDevice outputDevice) ITextRenderer(float dotsPerPoint, int dotsPerPixel, ITextOutputDevice outputDevice, FontResolver fontResolver) ITextRenderer(float dotsPerPoint, int dotsPerPixel, ITextOutputDevice outputDevice, ITextUserAgent userAgent) ITextRenderer(float dotsPerPoint, int dotsPerPixel, ITextOutputDevice outputDevice, ITextUserAgent userAgent, FontResolver fontResolver) ITextRenderer(float dotsPerPoint, int dotsPerPixel, ITextOutputDevice outputDevice, ITextUserAgent userAgent, FontResolver fontResolver, ReplacedElementFactory replacedElementFactory, TextRenderer textRenderer) ITextRenderer(File file) ITextRenderer(FontResolver fontResolver) ITextRenderer(ITextOutputDevice outputDevice, ITextUserAgent userAgent) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidcreatePDF(OutputStream os, boolean finish) voidcreatePDF(OutputStream os, boolean finish, int initialPageNo) NOTE: Caller is responsible for cleaning up the OutputStream if something goes wrong.byte[]voidcreatePDF(Document source, OutputStream os) private StringcreateXPacket(String metadata) voidexportText(Writer writer) findPagePositionsByID(Pattern pattern) voidprivate voidprivate voidprivate voidfirePreWrite(int pageCount) static ITextRendererfromString(String content) static ITextRendererfromString(String content, @Nullable String baseUrl) static ITextRenderer@Nullable Documentfloatprivate static @Nullable ElementgetFirstChildElement(Element element) private Rectangle@Nullable PDFCreationListener@Nullable PDFEncryptioncharint@Nullable BlockBox@Nullable com.lowagie.text.pdf.PdfWritervoidlayout()private DocumentloadDocument(String uri) private LayoutContextprivate RenderingContextnewRenderingContext(int initialPageNo) private voidpaintPage(RenderingContext c, com.lowagie.text.pdf.PdfWriter writer, PageBox page) private Documentprivate voidprovideMetadataToPage(com.lowagie.text.pdf.PdfWriter writer, PageBox page) private voidsetDidValues(com.lowagie.text.Document doc) voidsetDocument(Document doc) voidsetDocument(Document doc, @Nullable String url) private voidsetDocument(Document doc, @Nullable String url, NamespaceHandler nsh) Deprecated.final voidsetDocumentFromString(String content) final voidsetDocumentFromString(String content, @Nullable String baseUrl) voidsetListener(PDFCreationListener listener) voidsetPDFEncryption(PDFEncryption pdfEncryption) voidsetPDFVersion(char _v) voidsetPDFXConformance(int pdfXConformance) private @Nullable StringstringifyMetadata(Element element) voidvoidwriteNextDocument(int initialPageNo) private voidwritePDF(List<PageBox> pages, RenderingContext c, com.lowagie.text.Rectangle firstPageSize, com.lowagie.text.Document doc, com.lowagie.text.pdf.PdfWriter writer)
-
Field Details
-
DEFAULT_DOTS_PER_POINT
public static final float DEFAULT_DOTS_PER_POINT- See Also:
-
DEFAULT_DOTS_PER_PIXEL
public static final int DEFAULT_DOTS_PER_PIXEL- See Also:
-
_outputDevice
-
_doc
-
_root
-
_dotsPerPoint
private final float _dotsPerPoint -
_pdfDoc
private com.lowagie.text.Document _pdfDoc -
_writer
private @Nullable com.lowagie.text.pdf.PdfWriter _writer -
_pdfEncryption
-
_pdfVersion
-
validPdfVersions
private final char[] validPdfVersions -
_pdfXConformance
-
_listener
-
-
Constructor Details
-
ITextRenderer
- Throws:
IOException
-
ITextRenderer
public ITextRenderer() -
ITextRenderer
-
ITextRenderer
public ITextRenderer(float dotsPerPoint, int dotsPerPixel) -
ITextRenderer
-
ITextRenderer
-
ITextRenderer
-
ITextRenderer
public ITextRenderer(float dotsPerPoint, int dotsPerPixel, ITextOutputDevice outputDevice, FontResolver fontResolver) -
ITextRenderer
public ITextRenderer(float dotsPerPoint, int dotsPerPixel, ITextOutputDevice outputDevice, ITextUserAgent userAgent) -
ITextRenderer
public ITextRenderer(float dotsPerPoint, int dotsPerPixel, ITextOutputDevice outputDevice, ITextUserAgent userAgent, FontResolver fontResolver) -
ITextRenderer
public ITextRenderer(float dotsPerPoint, int dotsPerPixel, ITextOutputDevice outputDevice, ITextUserAgent userAgent, FontResolver fontResolver, ReplacedElementFactory replacedElementFactory, TextRenderer textRenderer)
-
-
Method Details
-
getDocument
-
getFontResolver
-
loadDocument
-
fromUrl
-
setDocument
-
setDocument
-
fromString
-
fromString
-
setDocumentFromString
-
setDocumentFromString
-
parse
-
setDocument
Deprecated. -
getPDFEncryption
-
setPDFEncryption
-
setPDFVersion
public void setPDFVersion(char _v) -
getPDFVersion
public char getPDFVersion() -
setPDFXConformance
public void setPDFXConformance(int pdfXConformance) -
getPDFXConformance
public int getPDFXConformance() -
layout
public void layout() -
getInitialExtents
-
newRenderingContext
-
newLayoutContext
-
createPDF
- Throws:
com.lowagie.text.DocumentException
-
createPDF
- Throws:
com.lowagie.text.DocumentException
-
createPDF
- Throws:
com.lowagie.text.DocumentException
-
writeNextDocument
public void writeNextDocument() -
writeNextDocument
public void writeNextDocument(int initialPageNo) -
finishPDF
public void finishPDF() -
createPDF
- Throws:
com.lowagie.text.DocumentException
-
createPDF
public void createPDF(OutputStream os, boolean finish, int initialPageNo) throws com.lowagie.text.DocumentException NOTE: Caller is responsible for cleaning up the OutputStream if something goes wrong.- Throws:
com.lowagie.text.DocumentException
-
firePreOpen
private void firePreOpen() -
firePreWrite
private void firePreWrite(int pageCount) -
fireOnClose
private void fireOnClose() -
writePDF
private void writePDF(List<PageBox> pages, RenderingContext c, com.lowagie.text.Rectangle firstPageSize, com.lowagie.text.Document doc, com.lowagie.text.pdf.PdfWriter writer) -
setDidValues
private void setDidValues(com.lowagie.text.Document doc) -
paintPage
-
provideMetadataToPage
-
stringifyMetadata
-
getFirstChildElement
-
createXPacket
-
getOutputDevice
-
exportText
- Throws:
IOException
-
getRootBox
-
getDotsPerPoint
public float getDotsPerPoint() -
findPagePositionsByID
-
getListener
-
setListener
-
getWriter
public @Nullable com.lowagie.text.pdf.PdfWriter getWriter()
-