Class HtmlDocument
java.lang.Object
com.itextpdf.commons.actions.sequence.AbstractIdentifiableElement
com.itextpdf.layout.ElementPropertyContainer
com.itextpdf.layout.RootElement
com.itextpdf.layout.Document
com.itextpdf.html2pdf.attach.impl.layout.HtmlDocument
- All Implemented Interfaces:
-
com.itextpdf.layout.IPropertyContainer
,Closeable
,AutoCloseable
public class HtmlDocument extends com.itextpdf.layout.Document
This class is a wrapper on
Document
, which is the default root element while creating a self-sufficient PDF. It contains several html-specific customizations.
-
Field Summary
Fields inherited from class com.itextpdf.layout.RootElement
childElements, defaultFont, defaultFontProvider, defaultSplitCharacters, immediateFlush, pdfDocument, rootRenderer
Fields inherited from class com.itextpdf.layout.ElementPropertyContainer
properties
-
Constructor Summary
ConstructorDescriptionHtmlDocument
(com.itextpdf.kernel.pdf.PdfDocument pdfDoc, com.itextpdf.kernel.geom.PageSize pageSize, boolean immediateFlush) Creates a html document from aPdfDocument
with a manually setPageSize
. -
Method Summary
Methods inherited from class com.itextpdf.layout.Document
add, add, checkClosingStatus, close, ensureRootRendererNotNull, flush, getBottomMargin, getDefaultProperty, getLeftMargin, getPageEffectiveArea, getPdfDocument, getRightMargin, getTopMargin, setBottomMargin, setLeftMargin, setMargins, setRenderer, setRightMargin, setTopMargin
Methods inherited from class com.itextpdf.layout.RootElement
add, createAndAddRendererSubTree, deleteOwnProperty, getFontProvider, getOwnProperty, getProperty, getRenderer, hasOwnProperty, hasProperty, setFontProvider, setProperty, showTextAligned, showTextAligned, showTextAligned, showTextAligned, showTextAligned, showTextAligned, showTextAlignedKerned
Methods inherited from class com.itextpdf.layout.ElementPropertyContainer
getSplitCharacters, getStrokeColor, getStrokeWidth, getTextRenderingMode, setBackgroundColor, setBackgroundColor, setBackgroundColor, setBackgroundColor, setBackgroundImage, setBackgroundImage, setBaseDirection, setBold, setBorder, setBorderBottom, setBorderBottomLeftRadius, setBorderBottomRightRadius, setBorderLeft, setBorderRadius, setBorderRight, setBorderTop, setBorderTopLeftRadius, setBorderTopRightRadius, setCharacterSpacing, setDestination, setFixedPosition, setFixedPosition, setFixedPosition, setFixedPosition, setFont, setFontColor, setFontColor, setFontColor, setFontFamily, setFontFamily, setFontKerning, setFontScript, setFontSize, setHorizontalAlignment, setHyphenation, setItalic, setLineThrough, setOpacity, setRelativePosition, setSplitCharacters, setStrokeColor, setStrokeWidth, setTextAlignment, setTextRenderingMode, setUnderline, setUnderline, setUnderline, setUnderline, setWordSpacing
-
Constructor Details
-
HtmlDocument
public HtmlDocument(com.itextpdf.kernel.pdf.PdfDocument pdfDoc, com.itextpdf.kernel.geom.PageSize pageSize, boolean immediateFlush) Creates a html document from aPdfDocument
with a manually setPageSize
.- Parameters:
-
pdfDoc
- the in-memory representation of the PDF document -
pageSize
- the page size -
immediateFlush
- if true, write pages and page-related instructions to thePdfDocument
as soon as possible.
-
-
Method Details
-
relayout
public void relayout()- Overrides:
-
relayout
in classcom.itextpdf.layout.Document
-