This class encapsulates the options to control the PDF document
redering process. The HtmlToPdfConverter class define
a reference to an object of this type.
Inheritance Hierarchy
WinnovativePdfDocumentOptions
Namespace: Winnovative
Assembly: wnvhtmltopdf (in wnvhtmltopdf.dll) Version: 17.0.0.0
Syntax
The PdfDocumentOptions type exposes the following members.
Constructors
Name | Description | |
---|---|---|
PdfDocumentOptions | Initializes a new instance of the PdfDocumentOptions class |
Properties
Name | Description | |
---|---|---|
AutoCloseExternalDocs |
This flag indicates if the external documents added by the AddStartDocument() and AddEndDocument() are automatically closed after the final document
was generated. By default the external documents are closed
| |
AutoSizePdfPage |
When the property AutoSizePdfPage property is true 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 the FitWidth and FitHeight properties are false.
When the FitWidth property is false (the HTML content is rendered at real size) and the AutoSizePdfPage 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
| |
AvoidHtmlElementsBreakSelectors |
Gets or sets the CSS selectors of the HTML elements to not be broken between PDF pages if possible
| |
AvoidImageBreak |
When true this property instructs the HTML to PDF converter to try to avoid cutting off the images between PDF pages. By default this property is false
| |
AvoidTextBreak |
When true this property instructs the HTML to PDF converter to try to avoid cutting off
the text between PDF pages. By default this property is true.
| |
BackColor |
The PDF pages background color
| |
BottomMargin |
The rendered PDF document bottom margin in points. 1 point is 1/72 inch. By default the left margin is 0.
| |
BottomSpacing |
A 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.
| |
ColorProfile |
Gets or sets the color profile of the PDF document generated by the HTML to PDF converter.
| |
ColorSpace |
Gets or 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.
| |
CompressCrossReference |
Set this property on true to store the cross-reference table and the trailer of the PDF document generated by the HTML to PDF converter in compressed cross-reference streams
and to reduce the PDF file size. The default value is false
| |
DocumentObject |
A reference to the internal Document object initialized by converter during conversion
| |
EmbedFonts |
When true this option instructs the HTML to PDF converter to 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
| |
EnhancedGraphicsQuality |
A 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
| |
FitHeight |
When this property is true 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.
| |
FitWidth |
When this property is true 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 the AutoSizePdfPage property can be set on true to automatically resize the PDF page width
to display the whole content.
| |
Height |
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
| |
ImagesScalingEnabled |
A 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
| |
InteractiveHiddenElements |
A flag indicating if the interactive features are enabled for hidden HTML elements. This property is false by default
| |
InternalLinksEnabled |
When true this option instructs 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.
| |
JpegCompressionEnabled |
Gets or sets a 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 the JpegCompressionLevel parameter. When the JpegCompressionLevel is increased, the quality of the images in PDF decreases.
| |
JpegCompressionLevel |
Gets or 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 the JpegCompressionEnabled is true.
When the JpegCompressionLevel is 0, the compression rate is the lowest and the quality of the images is the best.
When the JpegCompressionLevel 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.
| |
LeftMargin |
The rendered PDF document left margin in points. 1 point is 1/72 inch. By default the left margin is 0.
| |
LiveUrlsEnabled |
When true this option instructs the HTML to PDF converter to 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.
| |
NoSizeElementsEnabled |
A 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
| |
PageBreakAfterHtmlElementsSelectors |
Gets or sets the CSS selectors of the HTML elements after which to force a page break in PDF document
| |
PageBreakBeforeHtmlElementsSelectors |
Gets or sets the CSS selectors of the HTML elements before which to force a page break in PDF document
| |
PdfCompressionLevel |
This property controls the compression level of the PDF document created by the HTML to PDF converter.
| |
PdfPageOrientation |
This property controls the page orientation of the pages of the PDF document generated by the HTML to PDF converter.
The default orientation is Portrait.
| |
PdfPageSize |
This property controls the page size of the PDF document generated by the HTML to PDF converter.
The default size of the PDF document page is A4
| |
PdfStandardSubset |
Defines 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.
| |
RightMargin |
The rendered PDF document right margin in points. 1 point is 1/72 inch. By default the right margin is 0.
| |
ShowFooter |
This property controls the whether the footer appears or not in the PDF document generated by the HTML to PDF converter.
The footer properties can be further customized by setting the properties of object exposed by the
PdfFooterOptions property of the HtmlToPdfConverter class.
The default value of this property is false.
| |
ShowHeader |
This property controls the whether the header appears or not in the PDF document generated by the HTML to PDF converter.
The header properties can be further customized by setting the properties of object exposed by the
PdfHeaderOptions property of the HtmlToPdfConverter class.
The default value of this property is false.
| |
SinglePage |
When this property is true 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 the FitWidth 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.
| |
StackRepeatedTableFooters |
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.
Default value is true
| |
StackRepeatedTableHeaders |
Gets or sets a 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
| |
StretchToFit |
This property has effect in HTML to PDF converter only when FitWidth property is true. When FitWidth 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.
| |
TableFooterRepeatEnabled |
Gets or sets a 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.
Default value is true
| |
TableHeaderRepeatEnabled |
Gets or sets a 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
| |
TiledRenderingEnabled |
A 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
| |
TopMargin |
The rendered PDF document top margin in points. 1 point is 1/72 inch. By default the top margin is 0.
| |
TopSpacing |
A 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.
| |
TransparencyEnabled |
Gets or sets a 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.
| |
TransparentImagesEnabled |
A 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
| |
Width |
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
| |
X |
The X coordinate in points where to start HTML rendering in first page. By default the left location is 0
| |
Y |
The Y coordinate in points where to start HTML rendering in first page. By default the top location is 0
|
Methods
Name | Description | |
---|---|---|
AddEndDocument(Document) |
Adds a PDF document object after the result of HTML to PDF conversion. If the AutoCloseExternalDocs property is true the
added document will be automatically closed when the final document is closed or saved. 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 the AddEndDocument(Document, Boolean, Boolean, Boolean) | |
AddEndDocument(Stream) |
Adds a PDF document from the given stream after the result of HTML to PDF conversion. If the AutoCloseExternalDocs property is true the
added document will be automatically closed when the final document is closed or saved. 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 the AddEndDocument(Stream, Boolean, Boolean, Boolean) | |
AddEndDocument(String) |
Adds a PDF document from the given file after the result of HTML to PDF conversion. If the AutoCloseExternalDocs property is true the
added document will be automatically closed when the final document is closed or saved. 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 the AddEndDocument(String, Boolean, Boolean, Boolean) | |
AddEndDocument(Document, Boolean, Boolean, Boolean) |
Adds a PDF document object after the result of HTML to PDF conversion. If the AutoCloseExternalDocs property is true the
added document will be automatically closed when the final document is closed or saved
| |
AddEndDocument(Stream, Boolean, Boolean, Boolean) |
Adds a PDF document from the given stream after the result of HTML to PDF conversion. If the AutoCloseExternalDocs property is true the
added document will be automatically closed when the final document is closed or saved
| |
AddEndDocument(String, Boolean, Boolean, Boolean) |
Adds a PDF document from the given file after the result of HTML to PDF conversion. If the AutoCloseExternalDocs property is true the
added document will be automatically closed when the final document is closed or saved
| |
AddStartDocument(Document) |
Adds a PDF document object before the result of HTML to PDF conversion. If the AutoCloseExternalDocs property is true the
added document will be automatically closed when the final document is closed or saved. 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 the AddStartDocument(Document, Boolean, Boolean, Boolean) | |
AddStartDocument(Stream) |
Adds a PDF document from the given stream before the result of HTML to PDF conversion. If the AutoCloseExternalDocs property is true the
added document will be automatically closed when the final document is closed or saved. 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 the AddStartDocument(Stream, Boolean, Boolean, Boolean) | |
AddStartDocument(String) |
Adds a PDF document from the given file before the result of HTML to PDF conversion. If the AutoCloseExternalDocs property is true the
added document will be automatically closed when the final document is closed or saved. 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 the AddStartDocument(String, Boolean, Boolean, Boolean) | |
AddStartDocument(Document, Boolean, Boolean, Boolean) |
Adds a PDF document object before the result of HTML to PDF conversion. If the AutoCloseExternalDocs property is true the
added document will be automatically closed when the final document is closed or saved.
| |
AddStartDocument(Stream, Boolean, Boolean, Boolean) |
Adds a PDF document from the given stream before the result of HTML to PDF conversion. If the AutoCloseExternalDocs property is true the
added document will be automatically closed when the final document is closed or saved
| |
AddStartDocument(String, Boolean, Boolean, Boolean) |
Adds a PDF document from the given file before the result of HTML to PDF conversion. If the AutoCloseExternalDocs property is true the
added document will be automatically closed when the final document is closed or saved
| |
Equals | (Inherited from Object.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
See Also