When you need to test printing processes in Java, it may be easier to print to files rather than printing to a printer. In the sample Java program below, we are finding the Microsoft XPS Document Writer, but you could find any other printer drivers installed on your machine, such as a Postscript driver or […]
Articles Tagged: print to file
Print PDF to Printer File Format (PCL, PRL, or PS) using Java
Here is a simple Java program showing how to use jPDFPrint to print a PDF document to a printer driver file format. In this example, the printer outputs a pcl file (Printer Command Language) but printers might output a prn file or postcript file. // Load the PDF document PDFPrint pdfPrint = new PDFPrint("input.pdf", null); […]