Last active
April 21, 2023 06:01
-
-
Save aspose-com-kb/d5e6dddbca8a5203c7c521eb783d2e24 to your computer and use it in GitHub Desktop.
How to Print PDF in Java. For further details: https://kb.aspose.com/pdf/java/how-to-print-pdf-in-java/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void main(String[] args) throws Exception // Print PDF in Java | |
{ | |
// Set the license | |
new com.aspose.pdf.License().setLicense("Aspose.Total.lic"); | |
// Create PdfViewer object | |
com.aspose.pdf.facades.PdfViewer viewer = new com.aspose.pdf.facades.PdfViewer(); | |
// Open input PDF file | |
viewer.bindPdf("print.pdf"); | |
// Print PDF document | |
viewer.printDocument(); | |
// Close PDF file | |
viewer.close(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment