In this article, I will show you how to print a PDF file with custom settings, such as silently print to a default printer and set the number of copies, show print dialog when printing, and print to a specific printer with custom paper size in Java using Free Spire.PDF for Java library. Import Jar File Download Free Spire.PDF for Java from this Link , you’ll find the jar file under the lib folder, add it into your project. If your project is a maven project, refer this online tutorial to install Free Spire.PDF for Java into your project. Print PDF File Silently with Default Printer import com.spire.pdf.*; import java.awt.print.*; public class Print { public static void main(String[] args) { //load the sample document PdfDocument pdf = new PdfDocument(); pdf.loadFromFile("Sample.pdf"); ...
A blog about Microsoft Office and PDF document development using .NET and Java.