Package com.winnovative_software
Class PdfDocumentOptions
java.lang.Object
com.winnovative_software.PdfDocumentOptions
This class encapsulates the options to control the PDF document rendering
process. The HtmlToPdfConverter class define a reference to an object of this
type.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addEndDocument
(byte[] pdfData) Adds a PDF document from the given stream after the result of HTML to PDF conversion.void
addEndDocument
(byte[] pdfData, boolean enableHeaderAndFooter, boolean drawHeaderOnFirstPage, boolean drawFooterOnFirstPage) Adds a PDF document from the given stream after the result of HTML to PDF conversionvoid
addEndDocument
(String pdfFile) Adds a PDF document from the given file after the result of HTML to PDF conversion.The header and footer are not applied to the PDF documents added by this method.void
addEndDocument
(String pdfFile, boolean enableHeaderAndFooter, boolean drawHeaderOnFirstPage, boolean drawFooterOnFirstPage) Adds a PDF document from the given file after the result of HTML to PDF conversionvoid
addStartDocument
(byte[] pdfData) Adds a PDF document from the given stream before the result of HTML to PDF conversion.void
addStartDocument
(byte[] pdfData, boolean enableHeaderAndFooter, boolean drawHeaderOnFirstPage, boolean drawFooterOnFirstPage) Adds a PDF document from the given stream before the result of HTML to PDF conversionvoid
addStartDocument
(String pdfFile) Adds a PDF document from the given file before the result of HTML to PDF conversion.void
addStartDocument
(String pdfFile, boolean enableHeaderAndFooter, boolean drawHeaderOnFirstPage, boolean drawFooterOnFirstPage) Adds a PDF document from the given file before the result of HTML to PDF conversionboolean
Gets the flag indicating if the HTML to PDF converter will automatically calculate the PDF page size such that all the HTML content will be visible in the resulted PDF document.String[]
Gets the CSS selectors of the HTML elements to not be broken between PDF pages if possible.boolean
Gets the flag indicating if the HTML to PDF converter will try to avoid cutting off the images between PDF pages.boolean
Gets the flag indicating if the HTML to PDF converter will try to avoid cutting off the text between PDF pages.Gets the PDF pages background colorfloat
Gets the rendered PDF document bottom margin in points.float
Gets the space in points to introduce at the bottom of PDF pages where the HTML is rendered.Gets the color profile of the PDF document generated by the HTML to PDF converter.Gets the color space of the PDF document generated by the HTML to PDF converter.boolean
Gets the flag indicating if the cross-reference table and the trailer of the PDF document generated by the HTML to PDF converter in compressed cross-reference streams to reduce the PDF file size.boolean
Gets the flag indicating if the HTML to PDF converter will embed all the true type fonts in the PDF document generated by the HTML to PDF converter.boolean
Gets the flag indicating the PDF graphics are rendered at the best quality in the PDF document generated by the HTML to PDF converter.boolean
Gets the fag indicating if the HTML content will be resized if necessary to fit the available height in PDF page of the PDF document generated by the HTML to PDF converter.boolean
fitWidth()
Gets the fag indicating if the HTML content will be resized if necessary to fit the available width in PDF page of the PDF document generated by the HTML to PDF converter.float
height()
Gets the height in points of the destination rectangle in PDF page where the HTML content is rendered.boolean
Gets the flag indicating if the images scaling is allowed in the PDF document generated by the HTML to PDF converter.boolean
Gets the flag indicating if the interactive features are enabled for hidden HTML elements.boolean
Gets the flag indicating if the HTML to PDF converter to convert the internal HTML links (links with anchors) to internal PDF links in the PDF document generated by the HTML to PDF converter.boolean
Gets the flag indicating if the JPEG compression is enabled or not for the images in the PDF document created by the HTML to PDF converter.int
Gets the compression level of images in the PDF document generated by the HTML to PDF converter as an integer value between 0 and 100.float
Gets the rendered PDF document left margin in points.boolean
Gets the flag indicating if the HTML to PDF converter will convert the external links from HTML to PDF links in the PDF document generated by the HTML to PDF converter.boolean
Gets the flag indicating if the hidden elements are rendered in the PDF document generated by the HTML to PDF converter.String[]
Gets the CSS selectors of the HTML elements after which to force a page break in PDF documentString[]
Gets the CSS selectors of the HTML elements before which to force a page break in PDF documentGets the compression level of the PDF document created by the HTML to PDF converter.Gets the page orientation of the pages of the PDF document generated by the HTML to PDF converter.Gets the page size of the PDF document generated by the HTML to PDF converter.Gets the PDF subset used by the PDF document generated by the HTML to PDF converter.float
Gets the rendered PDF document right margin in points.void
setAutoSizePdfPage
(boolean autoSizePdfPage) Sets the flag indicating if the HTML to PDF converter will automatically calculate the PDF page size such that all the HTML content will be visible in the resulted PDF document.void
setAvoidHtmlElementsBreakSelectors
(String[] selectors) Sets the CSS selectors of the HTML elements to not be broken between PDF pages if possible.void
setAvoidImageBreak
(boolean avoidImageBreak) Sets the flag indicating if the HTML to PDF converter will try to avoid cutting off the images between PDF pages.void
setAvoidTextBreak
(boolean avoidTextBreak) Sets the flag indicating if the HTML to PDF converter will try to avoid cutting off the text between PDF pages.void
setBackColor
(RgbColor backColor) Sets the PDF pages background colorvoid
setBottomMargin
(float bottomMargin) Sets the rendered PDF document bottom margin in points.void
setBottomSpacing
(float bottomSpacing) Sets the space in points to introduce at the bottom of PDF pages where the HTML is rendered.void
setColorProfile
(ColorProfile colorProfile) Sets the color profile of the PDF document generated by the HTML to PDF converter.void
setColorSpace
(ColorSpace colorSpace) Sets the color space of the PDF document generated by the HTML to PDF converter.void
setCompressCrossReference
(boolean compress) Sets the flag indicating if the cross-reference table and the trailer of the PDF document generated by the HTML to PDF converter in compressed cross-reference streams to reduce the PDF file size.void
setEmbedFonts
(boolean embedFonts) Sets the flag indicating if the HTML to PDF converter will embed all the true type fonts in the PDF document generated by the HTML to PDF converter.void
setEnhancedGraphicsQuality
(boolean enabled) Sets the flag indicating the PDF graphics are rendered at the best quality in the PDF document generated by the HTML to PDF converter.void
setFitHeight
(boolean fitHeight) Sets the fag indicating if the HTML content will be resized if necessary to fit the available height in PDF page of the PDF document generated by the HTML to PDF converter.void
setFitWidth
(boolean fitWidth) Sets the fag indicating if the HTML content will be resized if necessary to fit the available width in PDF page of the PDF document generated by the HTML to PDF converter.void
setHeight
(float height) Sets the height in points of the destination rectangle in PDF page where the HTML content is rendered.void
setImagesScalingEnabled
(boolean enabled) Sets flag indicating if the images scaling is allowed in the PDF document generated by the HTML to PDF converter.void
setInteractiveHiddenElements
(boolean enabled) Sets the flag indicating if the interactive features are enabled for hidden HTML elements.void
setInternalLinksEnabled
(boolean enabled) Sets the flag indicating if the HTML to PDF converter to convert the internal HTML links (links with anchors) to internal PDF links in the PDF document generated by the HTML to PDF converter.void
setJpegCompressionEnabled
(boolean enabled) Sets the flag indicating if the JPEG compression is enabled or not for the images in the PDF document created by the HTML to PDF converter.void
setJpegCompressionLevel
(int level) Sets the compression level of images in the PDF document generated by the HTML to PDF converter as an integer value between 0 and 100.void
setLeftMargin
(float leftMargin) Sets the rendered PDF document left margin in points.void
setLiveUrlsEnabled
(boolean enabled) Sets the flag indicating if the HTML to PDF converter will convert the external links from HTML to PDF links in the PDF document generated by the HTML to PDF converter.void
setNoSizeElementsEnabled
(boolean enabled) Sets flag indicating if the hidden elements are rendered in the PDF document generated by the HTML to PDF converter.void
setPageBreakAfterHtmlElementsSelectors
(String[] selectors) Sets the CSS selectors of the HTML elements after which to force a page break in PDF documentvoid
setPageBreakBeforeHtmlElementsSelectors
(String[] selectors) Sets the CSS selectors of the HTML elements before which to force a page break in PDF documentvoid
setPdfCompressionLevel
(PdfCompressionLevel compressionLevel) Sets the compression level of the PDF document created by the HTML to PDF converter.void
setPdfPageOrientation
(PdfPageOrientation orientation) Sets the page orientation of the pages of the PDF document generated by the HTML to PDF converter.void
setPdfPageSize
(PdfPageSize size) Sets the page size of the PDF document generated by the HTML to PDF converter.void
Sets the PDF subset used by the PDF document generated by the HTML to PDF converter.void
setRightMargin
(float rightMargin) Sets the rendered PDF document right margin in points.void
setShowFooter
(boolean showFooter) Sets the flag indicating if the footer is visible in the PDF document generated by the HTML to PDF converter.void
setShowHeader
(boolean showHeader) Sets the flag indicating if the header is visible in the PDF document generated by the HTML to PDF converter.void
setSinglePage
(boolean singlePage) Sets the flag indicating if the HTML to PDF converter will generate a single PDF page with a custom size calculated to display the whole HTML content and any specified header and footer.void
setStackRepeatedTableFooters
(boolean stackTableFooters) Gets or sets a flag indicating if the repeated HTML table footers are stacked at the bottom of the PDF page when multiple HTML tables have repeated footers on that PDF page.void
setStackRepeatedTableHeaders
(boolean stackTableHeaders) Sets the flag indicating if the repeated HTML table headers are stacked at the top of the PDF page when multiple HTML tables have repeated headers on that PDF page.void
setStretchToFit
(boolean stretchToFit) Sets the value of the flag indicating if the HTML content will be stretched if necessary to fit the available width in PDF page.void
setTableFooterRepeatEnabled
(boolean enabled) Sets the flag indicating if the repeating of the HTML table footer in PDF pages is enabled in the PDF document generated by the HTML to PDF converter.void
setTableHeaderRepeatEnabled
(boolean enabled) Sets the flag indicating if the repeating of the HTML table header in PDF pages is enabled in the PDF document generated by the HTML to PDF converter.void
setTopMargin
(float topMargin) Sets the rendered PDF document top margin in points.void
setTopSpacing
(float topSpacig) Sets the space in points to introduce at the top of PDF pages where the HTML is rendered.void
setTransparencyEnabled
(boolean enabled) Sets the flag indicating if the transparency is enabled in the PDF document generated by the HTML to PDF converter.void
setTransparentImagesEnabled
(boolean enabled) Sets flag indicating if the converter uses transparency information of the images in the PDF document generated by the HTML to PDF converter.void
setWidth
(float width) Sets the width in points of the destination rectangle in PDF page where the HTML content is rendered.void
setX
(float x) Sets the X coordinate in points where to start HTML rendering in first page.void
setY
(float y) Sets the Y coordinate in points where to start HTML rendering in first page.boolean
Gets the flag indicating if the footer is visible in the PDF document generated by the HTML to PDF converter.boolean
Gets the flag indicating if the header is visible in the PDF document generated by the HTML to PDF converter.boolean
Gets the flag indicating if the HTML to PDF converter will generate a single PDF page with a custom size calculated to display the whole HTML content and any specified header and footer.boolean
Gets the flag indicating if the repeated HTML table footers are stacked at the bottom of the PDF page when multiple HTML tables have repeated footers on that PDF page.boolean
Gets the flag indicating if the repeated HTML table headers are stacked at the top of the PDF page when multiple HTML tables have repeated headers on that PDF page.boolean
Gets the value of the flag indicating if the HTML content will be stretched if necessary to fit the available width in PDF page.boolean
Gets the flag indicating if the repeating of the HTML table footer in PDF pages is enabled in the PDF document generated by the HTML to PDF converter.boolean
Gets the flag indicating if the repeating of the HTML table header in PDF pages is enabled in the PDF document generated by the HTML to PDF converter.boolean
Gets the flag indicating if rendering of HTML document is tiled in the PDF document generated by the HTML to PDF converter.void
tiledRenderingEnabled
(boolean enabled) Sets the flag indicating if rendering of HTML document is tiled in the PDF document generated by the HTML to PDF converter.float
Gets the rendered PDF document top margin in points.float
Gets the space in points to introduce at the top of PDF pages where the HTML is rendered.boolean
Gets the flag indicating if the transparency is enabled in the PDF document generated by the HTML to PDF converter.boolean
Gets the flag indicating if the converter uses transparency information of the images in the PDF document generated by the HTML to PDF converter.float
width()
Gets the width in points of the destination rectangle in PDF page where the HTML content is rendered.float
x()
Gets the X coordinate in points where to start HTML rendering in first page.float
y()
Gets the Y coordinate in points where to start HTML rendering in first page.
-
Constructor Details
-
PdfDocumentOptions
public PdfDocumentOptions()
-
-
Method Details
-
addStartDocument
public void addStartDocument(String pdfFile, boolean enableHeaderAndFooter, boolean drawHeaderOnFirstPage, boolean drawFooterOnFirstPage) throws Exception Adds a PDF document from the given file before the result of HTML to PDF conversion- Parameters:
pdfFile
- the full path of the PDF file to be inserted before conversion resultenableHeaderAndFooter
- a flag indicating if the header and footer can be applied to the added document. If this parameter is true then the interactive features like links and bookmarks are disabled in the added PDF documentdrawHeaderOnFirstPage
- a flag indicating if the header is drawn on first page of the appended documentdrawFooterOnFirstPage
- a flag indicating if the footer is drawn in first page of the appended document- Throws:
Exception
- throws an exception if the PDF file cannot be opened
-
addStartDocument
public void addStartDocument(byte[] pdfData, boolean enableHeaderAndFooter, boolean drawHeaderOnFirstPage, boolean drawFooterOnFirstPage) Adds a PDF document from the given stream before the result of HTML to PDF conversion- Parameters:
pdfData
- the binary data of the PDF document to be inserted before conversion resultenableHeaderAndFooter
- a flag indicating if the header and footer can be applied to the added document. If this parameter is true then the interactive features like links and bookmarks are disabled in the added PDF documentdrawHeaderOnFirstPage
- a flag indicating if the header is drawn on first page of the appended documentdrawFooterOnFirstPage
- a flag indicating if the footer is drawn in first page of the appended document
-
addEndDocument
public void addEndDocument(String pdfFile, boolean enableHeaderAndFooter, boolean drawHeaderOnFirstPage, boolean drawFooterOnFirstPage) throws Exception Adds a PDF document from the given file after the result of HTML to PDF conversion- Parameters:
pdfFile
- the full path of the PDF file to be inserted after conversion resultenableHeaderAndFooter
- a flag indicating if the header and footer can be applied to the added document. If this parameter is true then the interactive features like links and bookmarks are disabled in the added PDF documentdrawHeaderOnFirstPage
- a flag indicating if the header is drawn on first page of the appended documentdrawFooterOnFirstPage
- a flag indicating if the footer is drawn in first page of the appended document- Throws:
Exception
- throws an exception if the PDF file cannot be opened
-
addEndDocument
public void addEndDocument(byte[] pdfData, boolean enableHeaderAndFooter, boolean drawHeaderOnFirstPage, boolean drawFooterOnFirstPage) Adds a PDF document from the given stream after the result of HTML to PDF conversion- Parameters:
pdfData
- the binary data of the PDF document to be inserted before conversion resultenableHeaderAndFooter
- a flag indicating if the header and footer can be applied to the added document. If this parameter is true then the interactive features like links and bookmarks are disabled in the added PDF documentdrawHeaderOnFirstPage
- a flag indicating if the header is drawn on first page of the appended documentdrawFooterOnFirstPage
- a flag indicating if the footer is drawn in first page of the appended document
-
addStartDocument
Adds a PDF document from the given file before the result of HTML to PDF conversion. The header and footer are not applied to the PDF documents added by this method. If you want to enable the header and footer in the added PDF document use theaddStartDocument(String, boolean, boolean, boolean)
- Parameters:
pdfFile
- the full path of the PDF file to be inserted before conversion result- Throws:
Exception
- throws an exception if the PDF file cannot be opened
-
addStartDocument
public void addStartDocument(byte[] pdfData) Adds a PDF document from the given stream before the result of HTML to PDF conversion. The header and footer are not applied to the PDF documents added by this method. If you want to enable the header and footer in the added PDF document use theaddStartDocument(byte[], boolean, boolean, boolean)
- Parameters:
pdfData
- the binary data of the PDF document to be inserted before conversion result
-
addEndDocument
Adds a PDF document from the given file after the result of HTML to PDF conversion.The header and footer are not applied to the PDF documents added by this method. If you want to enable the header and footer in the added PDF document use theaddEndDocument(String, boolean, boolean, boolean)
- Parameters:
pdfFile
- the full path of the PDF file to be inserted after conversion result- Throws:
Exception
- throws an exception if the PDF file cannot be opened
-
addEndDocument
public void addEndDocument(byte[] pdfData) Adds a PDF document from the given stream after the result of HTML to PDF conversion. The header and footer are not applied to the PDF documents added by this method. If you want to enable the header and footer in the added PDF document use theaddEndDocument(byte[], boolean, boolean, boolean)
- Parameters:
pdfData
- the binary data of the PDF document to be inserted before conversion result
-
leftMargin
public float leftMargin()Gets the rendered PDF document left margin in points. 1 point is 1/72 inch.- Returns:
- the PDF document left margin in points
-
setLeftMargin
public void setLeftMargin(float leftMargin) Sets the rendered PDF document left margin in points. 1 point is 1/72 inch. By default the left margin is 0.- Parameters:
leftMargin
- the PDF document left margin in points
-
rightMargin
public float rightMargin()Gets the rendered PDF document right margin in points. 1 point is 1/72 inch.- Returns:
- the PDF document right margin in points
-
setRightMargin
public void setRightMargin(float rightMargin) Sets the rendered PDF document right margin in points. 1 point is 1/72 inch. By default the right margin is 0.- Parameters:
rightMargin
- the PDF document right margin in points
-
topMargin
public float topMargin()Gets the rendered PDF document top margin in points. 1 point is 1/72 inch.- Returns:
- the PDF document top margin in points
-
setTopMargin
public void setTopMargin(float topMargin) Sets the rendered PDF document top margin in points. 1 point is 1/72 inch. By default the top margin is 0.- Parameters:
topMargin
- the PDF document top margin in points
-
bottomMargin
public float bottomMargin()Gets the rendered PDF document bottom margin in points. 1 point is 1/72 inch.- Returns:
- the PDF document bottom margin in points
-
setBottomMargin
public void setBottomMargin(float bottomMargin) Sets the rendered PDF document bottom margin in points. 1 point is 1/72 inch. By default the bottom margin is 0.- Parameters:
bottomMargin
- the PDF document bottom margin in points
-
x
public float x()Gets the X coordinate in points where to start HTML rendering in first page.- Returns:
- the X coordinate
-
setX
public void setX(float x) Sets the X coordinate in points where to start HTML rendering in first page. By default the left location is 0.- Parameters:
x
- the X coordinate
-
y
public float y()Gets the Y coordinate in points where to start HTML rendering in first page. By default the top location is 0.- Returns:
- the Y coordinate
-
setY
public void setY(float y) Sets the Y coordinate in points where to start HTML rendering in first page. By default the top location is 0.- Parameters:
y
- the Y coordinate
-
width
public float width()Gets the width in points of the destination rectangle in PDF page where the HTML content is rendered.- Returns:
- the width in points of the destination rectangle
-
setWidth
public void setWidth(float width) Sets the width in points of the destination rectangle in PDF page where the HTML content is rendered. By default the destination width is the available width in PDF page- Parameters:
width
- the width in points of the destination rectangle
-
height
public float height()Gets the height in points of the destination rectangle in PDF page where the HTML content is rendered.- Returns:
- the height in points of the destination rectangle
-
setHeight
public void setHeight(float height) Sets the height in points of the destination rectangle in PDF page where the HTML content is rendered. By default the destination height is automatically calculated to render the whole HTML content- Parameters:
height
- the height in points of the destination rectangle
-
topSpacing
public float topSpacing()Gets the space in points to introduce at the top of PDF pages where the HTML is rendered. 1 point is 1/72 inch.- Returns:
- the space in points to introduce at the top of PDF pages
-
setTopSpacing
public void setTopSpacing(float topSpacig) Sets the space in points to introduce at the top of PDF pages where the HTML is rendered. 1 point is 1/72 inch. By default the top spacing is 0.- Parameters:
topSpacig
- the space in points to introduce at the top of PDF pages
-
bottomSpacing
public float bottomSpacing()Gets the space in points to introduce at the bottom of PDF pages where the HTML is rendered. 1 point is 1/72 inch. By default the bottom spacing is 0.- Returns:
- the space in points to introduce at the bottom of PDF pages
-
setBottomSpacing
public void setBottomSpacing(float bottomSpacing) Sets the space in points to introduce at the bottom of PDF pages where the HTML is rendered. 1 point is 1/72 inch. By default the bottom spacing is 0.- Parameters:
bottomSpacing
- the space in points to introduce at the bottom of PDF pages
-
backColor
Gets the PDF pages background color- Returns:
- the PDF pages background color
-
setBackColor
Sets the PDF pages background color- Parameters:
backColor
- the PDF pages background color
-
pdfCompressionLevel
Gets the compression level of the PDF document created by the HTML to PDF converter.- Returns:
- the compression level of the PDF document
-
setPdfCompressionLevel
Sets the compression level of the PDF document created by the HTML to PDF converter.- Parameters:
compressionLevel
- the compression level of the PDF document
-
jpegCompressionEnabled
public boolean jpegCompressionEnabled()Gets the flag indicating if the JPEG compression is enabled or not for the images in the PDF document created by the HTML to PDF converter.- Returns:
- the flag indicating if the JPEG compression is enabled or not
-
setJpegCompressionEnabled
public void setJpegCompressionEnabled(boolean enabled) Sets the flag indicating if the JPEG compression is enabled or not for the images in the PDF document created by the HTML to PDF converter. By default the JPEG compression is enabled to reduce the size of the generated PDF. When the JPEG compression is enabled the quality of the images in the generated PDF is lower than the quality of the original images in the HTML document, function of thejpegCompressionLevel()
parameter. When thejpegCompressionLevel()
is increased, the quality of the images in PDF decreases.- Parameters:
enabled
- the flag value to set
-
jpegCompressionLevel
public int jpegCompressionLevel()Gets the compression level of images in the PDF document generated by the HTML to PDF converter as an integer value between 0 and 100.- Returns:
- the compression level of images in the generated PDF document
-
setJpegCompressionLevel
public void setJpegCompressionLevel(int level) Sets the compression level of images in the PDF document generated by the HTML to PDF converter as an integer value between 0 and 100. This property has effect only when thejpegCompressionEnabled()
is true. When thejpegCompressionLevel()
is 0, the compression rate is the lowest and the quality of the images is the best. When thejpegCompressionLevel()
is 100, the compression rate is the highest and quality of the images in PDF is the worst. The default JPEG compression level is 10, which should offer a good balance between the compression rate and the quality of the images in PDF.- Parameters:
level
- the compression level of images
-
compressCrossReference
public boolean compressCrossReference()Gets the flag indicating if the cross-reference table and the trailer of the PDF document generated by the HTML to PDF converter in compressed cross-reference streams to reduce the PDF file size.- Returns:
- the flag value
-
setCompressCrossReference
public void setCompressCrossReference(boolean compress) Sets the flag indicating if the cross-reference table and the trailer of the PDF document generated by the HTML to PDF converter in compressed cross-reference streams to reduce the PDF file size. The default value is false- Parameters:
compress
- the flag value to set
-
pdfPageSize
Gets the page size of the PDF document generated by the HTML to PDF converter.- Returns:
- the PDF page size
-
setPdfPageSize
Sets the page size of the PDF document generated by the HTML to PDF converter. The default size of the PDF document page is A4.- Parameters:
size
- the PDF page size
-
pdfStandardSubset
Gets the PDF subset used by the PDF document generated by the HTML to PDF converter.- Returns:
- the PDF subset used by the generated PDF document
-
setPdfStandardSubset
Sets the PDF subset used by the PDF document generated by the HTML to PDF converter. The default value is Full. This property can be used to instruct the converter to generate PDF/A or PDF/X compliant documents.- Parameters:
subset
- the PDF subset to be used by the generated PDF document
-
colorSpace
Gets the color space of the PDF document generated by the HTML to PDF converter.- Returns:
- the color space of the generated PDF document
-
setColorSpace
Sets the color space of the PDF document generated by the HTML to PDF converter. The possible values are RGB, CMYK or Gray Scale. The default color space is RGB.- Parameters:
colorSpace
- the color space of the generated PDF document
-
colorProfile
Gets the color profile of the PDF document generated by the HTML to PDF converter.- Returns:
- the color profile of the generated PDF document
-
setColorProfile
Sets the color profile of the PDF document generated by the HTML to PDF converter.- Parameters:
colorProfile
- the color profile to set
-
fitWidth
public boolean fitWidth()Gets the fag indicating if the HTML content will be resized if necessary to fit the available width in PDF page of the PDF document generated by the HTML to PDF converter.- Returns:
- the flag value
-
setFitWidth
public void setFitWidth(boolean fitWidth) Sets the fag indicating if the HTML content will be resized if necessary to fit the available width in PDF page of the PDF document generated by the HTML to PDF converter. By default this property is true and the content will be resized if necessary to fit the available width in PDF page. When this property is false the HTML content is not resized (is rendered at the real size) and therefore it could be cut off at the right size if the PDF page is not enough wide to display the whole HTML content. In this case theautoSizePdfPage()
property can be set on true to automatically resize the PDF page width to display the whole content.- Parameters:
fitWidth
- the flag value to set
-
fitHeight
public boolean fitHeight()Gets the fag indicating if the HTML content will be resized if necessary to fit the available height in PDF page of the PDF document generated by the HTML to PDF converter.- Returns:
- the flag value
-
setFitHeight
public void setFitHeight(boolean fitHeight) Sets the fag indicating if the HTML content will be resized if necessary to fit the available height in PDF page of the PDF document generated by the HTML to PDF converter. By default this property is false.- Parameters:
fitHeight
- the flag value to set
-
stretchToFit
public boolean stretchToFit()Gets the value of the flag indicating if the HTML content will be stretched if necessary to fit the available width in PDF page.- Returns:
- the flag value
-
setStretchToFit
public void setStretchToFit(boolean stretchToFit) Sets the value of the flag indicating if the HTML content will be stretched if necessary to fit the available width in PDF page. This property has effect in HTML to PDF converter only whenfitWidth()
property is true. WhenfitWidth()
is true and this property is true the HTML content will be stretched if necessary to fit the available width in PDF page. By default this property is false and the content will not be stretched to fit the available width in PDF page.- Parameters:
stretchToFit
- the flag value to set
-
singlePage
public boolean singlePage()Gets the flag indicating if the HTML to PDF converter will generate a single PDF page with a custom size calculated to display the whole HTML content and any specified header and footer.- Returns:
- the flag value
-
setSinglePage
public void setSinglePage(boolean singlePage) Sets the flag indicating if the HTML to PDF converter will generate a single PDF page with a custom size calculated to display the whole HTML content and any specified header and footer. If thefitWidth()
property is true the specified PDF page width will be preserved, otherwise the PDF page width is automatically calculated by the converter to display the whole HTML content at real size.- Parameters:
singlePage
- the flag value to set
-
autoSizePdfPage
public boolean autoSizePdfPage()Gets the flag indicating if the HTML to PDF converter will automatically calculate the PDF page size such that all the HTML content will be visible in the resulted PDF document.- Returns:
- the flag value
-
setAutoSizePdfPage
public void setAutoSizePdfPage(boolean autoSizePdfPage) Sets the flag indicating if the HTML to PDF converter will automatically calculate the PDF page size such that all the HTML content will be visible in the resulted PDF document. This property has effect only when thefitWidth()
andfitHeight()
properties are false. When the FitWidth property is false (the HTML content is rendered at real size) and theautoSizePdfPage()
is false the rendered HTML content could be cut off at the right of the generated PDF document if the PDF page is not wide enough to display the whole content. This property is true by default- Parameters:
autoSizePdfPage
- the flag value to set
-
avoidTextBreak
public boolean avoidTextBreak()Gets the flag indicating if the HTML to PDF converter will try to avoid cutting off the text between PDF pages.- Returns:
- the flag value
-
setAvoidTextBreak
public void setAvoidTextBreak(boolean avoidTextBreak) Sets the flag indicating if the HTML to PDF converter will try to avoid cutting off the text between PDF pages. By default this property is true.- Parameters:
avoidTextBreak
- the flag value to set
-
avoidImageBreak
public boolean avoidImageBreak()Gets the flag indicating if the HTML to PDF converter will try to avoid cutting off the images between PDF pages.- Returns:
- the flag value
-
setAvoidImageBreak
public void setAvoidImageBreak(boolean avoidImageBreak) Sets the flag indicating if the HTML to PDF converter will try to avoid cutting off the images between PDF pages.- Parameters:
avoidImageBreak
- the flag value
-
avoidHtmlElementsBreakSelectors
Gets the CSS selectors of the HTML elements to not be broken between PDF pages if possible.- Returns:
- the CSS selectors
-
setAvoidHtmlElementsBreakSelectors
Sets the CSS selectors of the HTML elements to not be broken between PDF pages if possible.- Parameters:
selectors
- the CSS selectors to set
-
pageBreakBeforeHtmlElementsSelectors
Gets the CSS selectors of the HTML elements before which to force a page break in PDF document- Returns:
- the CSS selectors
-
setPageBreakBeforeHtmlElementsSelectors
Sets the CSS selectors of the HTML elements before which to force a page break in PDF document- Parameters:
selectors
- the CSS selectors to set
-
pageBreakAfterHtmlElementsSelectors
Gets the CSS selectors of the HTML elements after which to force a page break in PDF document- Returns:
- the CSS selectors
-
setPageBreakAfterHtmlElementsSelectors
Sets the CSS selectors of the HTML elements after which to force a page break in PDF document- Parameters:
selectors
- the CSS selectors to set
-
pdfPageOrientation
Gets the page orientation of the pages of the PDF document generated by the HTML to PDF converter.- Returns:
- the PDF pages orientation
-
setPdfPageOrientation
Sets the page orientation of the pages of the PDF document generated by the HTML to PDF converter. The default orientation isPdfPageOrientation.Portrait
.- Parameters:
orientation
- the PDF pages orientation to set
-
showHeader
public boolean showHeader()Gets the flag indicating if the header is visible in the PDF document generated by the HTML to PDF converter.- Returns:
- the flag value
-
setShowHeader
public void setShowHeader(boolean showHeader) Sets the flag indicating if the header is visible in the PDF document generated by the HTML to PDF converter. The header properties can be further customized by setting the properties of thePdfHeaderOptions
object exposed by theHtmlToPdfConverter
class throughHtmlToPdfConverter.pdfHeaderOptions()
property. The default value of this property is false.- Parameters:
showHeader
- the flag value to set
-
embedFonts
public boolean embedFonts()Gets the flag indicating if the HTML to PDF converter will embed all the true type fonts in the PDF document generated by the HTML to PDF converter.- Returns:
- the flag value
-
setEmbedFonts
public void setEmbedFonts(boolean embedFonts) Sets the flag indicating if the HTML to PDF converter will embed all the true type fonts in the PDF document generated by the HTML to PDF converter. The default value of this property is true.- Parameters:
embedFonts
- the flag value to set
-
liveUrlsEnabled
public boolean liveUrlsEnabled()Gets the flag indicating if the HTML to PDF converter will convert the external links from HTML to PDF links in the PDF document generated by the HTML to PDF converter.- Returns:
- the flag value
-
setLiveUrlsEnabled
public void setLiveUrlsEnabled(boolean enabled) Sets the flag indicating if the HTML to PDF converter will convert the external links from HTML to PDF links in the PDF document generated by the HTML to PDF converter. The default value is true.- Parameters:
enabled
- the flag value to set
-
interactiveHiddenElements
public boolean interactiveHiddenElements()Gets the flag indicating if the interactive features are enabled for hidden HTML elements.- Returns:
- the flag value
-
setInteractiveHiddenElements
public void setInteractiveHiddenElements(boolean enabled) Sets the flag indicating if the interactive features are enabled for hidden HTML elements. This property is false by default.- Parameters:
enabled
- the flag value to set
-
internalLinksEnabled
public boolean internalLinksEnabled()Gets the flag indicating if the HTML to PDF converter to convert the internal HTML links (links with anchors) to internal PDF links in the PDF document generated by the HTML to PDF converter.- Returns:
- the flag value
-
setInternalLinksEnabled
public void setInternalLinksEnabled(boolean enabled) Sets the flag indicating if the HTML to PDF converter to convert the internal HTML links (links with anchors) to internal PDF links in the PDF document generated by the HTML to PDF converter. The default value is true.- Parameters:
enabled
- the flag value to set
-
tiledRenderingEnabled
public boolean tiledRenderingEnabled()Gets the flag indicating if rendering of HTML document is tiled in the PDF document generated by the HTML to PDF converter.- Returns:
- the flag value
-
tiledRenderingEnabled
public void tiledRenderingEnabled(boolean enabled) Sets the flag indicating if rendering of HTML document is tiled in the PDF document generated by the HTML to PDF converter. This property is true by default- Parameters:
enabled
- the flag value to set
-
enhancedGraphicsQuality
public boolean enhancedGraphicsQuality()Gets the flag indicating the PDF graphics are rendered at the best quality in the PDF document generated by the HTML to PDF converter.- Returns:
- the flag value
-
setEnhancedGraphicsQuality
public void setEnhancedGraphicsQuality(boolean enabled) Sets the flag indicating the PDF graphics are rendered at the best quality in the PDF document generated by the HTML to PDF converter. The default property value is true.- Parameters:
enabled
- the flag value to set
-
transparentImagesEnabled
public boolean transparentImagesEnabled()Gets the flag indicating if the converter uses transparency information of the images in the PDF document generated by the HTML to PDF converter.- Returns:
- the flag value
-
setTransparentImagesEnabled
public void setTransparentImagesEnabled(boolean enabled) Sets flag indicating if the converter uses transparency information of the images in the PDF document generated by the HTML to PDF converter. The default property value is true- Parameters:
enabled
- the flag value to set
-
imagesScalingEnabled
public boolean imagesScalingEnabled()Gets the flag indicating if the images scaling is allowed in the PDF document generated by the HTML to PDF converter.- Returns:
- the flag value
-
setImagesScalingEnabled
public void setImagesScalingEnabled(boolean enabled) Sets flag indicating if the images scaling is allowed in the PDF document generated by the HTML to PDF converter. The default property value is false- Parameters:
enabled
- the flag value to set
-
noSizeElementsEnabled
public boolean noSizeElementsEnabled()Gets the flag indicating if the hidden elements are rendered in the PDF document generated by the HTML to PDF converter.- Returns:
- the flag value
-
setNoSizeElementsEnabled
public void setNoSizeElementsEnabled(boolean enabled) Sets flag indicating if the hidden elements are rendered in the PDF document generated by the HTML to PDF converter. The default property value is false- Parameters:
enabled
- the flag value to set
-
transparencyEnabled
public boolean transparencyEnabled()Gets the flag indicating if the transparency is enabled in the PDF document generated by the HTML to PDF converter.- Returns:
- the flag value
-
setTransparencyEnabled
public void setTransparencyEnabled(boolean enabled) Sets the flag indicating if the transparency is enabled in the PDF document generated by the HTML to PDF converter. Default value is true. This property can be set to false to eliminate the additional flattening time when the document is sent to the printer from Adobe Reader viewer.- Parameters:
enabled
- the flag value to set
-
tableHeaderRepeatEnabled
public boolean tableHeaderRepeatEnabled()Gets the flag indicating if the repeating of the HTML table header in PDF pages is enabled in the PDF document generated by the HTML to PDF converter.- Returns:
- the flag value
-
setTableHeaderRepeatEnabled
public void setTableHeaderRepeatEnabled(boolean enabled) Sets the flag indicating if the repeating of the HTML table header in PDF pages is enabled in the PDF document generated by the HTML to PDF converter. Default value is true- Parameters:
enabled
- the flag value to set
-
stackRepeatedTableHeaders
public boolean stackRepeatedTableHeaders()Gets the flag indicating if the repeated HTML table headers are stacked at the top of the PDF page when multiple HTML tables have repeated headers on that PDF page.- Returns:
- the flag value
-
setStackRepeatedTableHeaders
public void setStackRepeatedTableHeaders(boolean stackTableHeaders) Sets the flag indicating if the repeated HTML table headers are stacked at the top of the PDF page when multiple HTML tables have repeated headers on that PDF page. Default value is true.- Parameters:
stackTableHeaders
- the flag value to set
-