java.lang.Objectcom.aspose.words.AsposeWordsPrintDocument
public class AsposeWordsPrintDocument
A single Aspose.Words document can consist of multiple sections that specify pages with different sizes,
orientation and paper trays. On the other hand, if the document consists of a single section only, the developer can use Example:
Document doc = new Document(getMyDir() + "Rendering.doc");
PrinterJob pj = PrinterJob.getPrinterJob();
// Initialize the Print Dialog with the number of pages in the document.
PrintRequestAttributeSet attributes = new HashPrintRequestAttributeSet();
attributes.add(new PageRanges(1, doc.getPageCount()));
// Returns true if the user accepts the print dialog.
if (!pj.printDialog(attributes))
return;
// Create the Aspose.Words' implementation of the Java Pageable interface.
AsposeWordsPrintDocument awPrintDoc = new AsposeWordsPrintDocument(doc);
// Pass the document to the printer.
pj.setPageable(awPrintDoc);
// Print the document with the user specified print settings.
pj.print(attributes);
Constructor Summary |
---|
AsposeWordsPrintDocument(Document document)
Initializes a new instance of this class. |
Constructor Detail |
---|
public AsposeWordsPrintDocument(Document document)
document
- The document to print.