I have existing PDF files that are full 8.5" x 11". I'm trying to print them
using pdfbox, but I can't seem to figure out how to scale them to the printable
region for the printer. I'm using pdfbox-1.8.10.jar. Any help would be
greatly appreciated.
// get PDF
document = PDDocument.load( pdfFile );
// setup for printing
PrinterJob printJob = PrinterJob.getPrinterJob();
printJob.setJobName(new File(pdfFile).getName());
printJob.setPrintService(getPrinter(printerName));
// print PDF
printJob.setPageable(new PDPageable(document, printJob));
printJob.print();
// success
return "0";