public class AsposeWordsPrintDocument
extends java.lang.Object
implements java.awt.print.Pageable, java.awt.print.Printable
Document within the Java printing framework.
To learn more, visit the Printing a Document Programmatically or Using Dialogs documentation article.
AsposeWordsPrintDocument overrides both and .
A single Aspose.Words document can consist of multiple sections that specify pages with different sizes, orientation and paper trays. AsposeWordsPrintDocument should be used as to properly print each of the different paper size, orientation, etc.
On the other hand, if the document consists of a single section only, the developer can use AsposeWordsPrintDocument as to improve printing performance.
| Constructor and Description |
|---|
AsposeWordsPrintDocument(Document document)
Initializes a new instance of this class.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getNumberOfPages() |
java.awt.print.PageFormat |
getPageFormat(int pageIndex) |
java.awt.print.Printable |
getPrintable(int pageIndex) |
int |
print(java.awt.Graphics graphics,
java.awt.print.PageFormat pageFormat,
int pageIndex) |
public AsposeWordsPrintDocument(Document document)
document - The document to print.public int print(java.awt.Graphics graphics,
java.awt.print.PageFormat pageFormat,
int pageIndex)
throws java.awt.print.PrinterException
print in interface java.awt.print.Printablejava.awt.print.PrinterExceptionpublic int getNumberOfPages()
getNumberOfPages in interface java.awt.print.Pageablepublic java.awt.print.PageFormat getPageFormat(int pageIndex)
throws java.lang.IndexOutOfBoundsException
getPageFormat in interface java.awt.print.Pageablejava.lang.IndexOutOfBoundsExceptionpublic java.awt.print.Printable getPrintable(int pageIndex)
throws java.lang.IndexOutOfBoundsException
getPrintable in interface java.awt.print.Pageablejava.lang.IndexOutOfBoundsException