constructor(options?: any): PrintDocument
Initializes a new instance of the PrintDocument class.
JavaScript object containing initialization data for the PrintDocument.
Gets or sets a value that determines whether the PrintDocument should include the CSS style sheets defined in the main document.
addCSS(href: string): void
Adds a CSS style sheet to the document.
URL of the CSS file that should be added to the document.
append(child: any): void
Appends an HTML element or string to the document.
HTML element or string to append to the document.
print(): void
Prints the document.
Class that enables the creation of custom documents for printing.
The PrintDocument class makes it easy to create documents for printing or exporting to PDF. Most browsers allow you to select the paper size, orientation, margins, and whether to include page headers and footers.
To use, instantiate a append method, and finish by calling the print method.
For example: