I use the PDFBox 1.8.3 jar to print a PDF file in printer(HW). I printed the PDF file in both ways normal and program. When I print the PDF using normal way, I got the original pdf file as a printed document. But when I use my code I'm unable to get the original pdf file as the printed output. I can see a couple of changes in the printed file; for example alignments, font and ink are different from the original document.
ReadPDF readPDF = new ReadPDF();
PDDocument document = readPDF.loadPdf(path);
document.addPage(new PDPage());
printerJob.setPageable(document);
printRequestAttributeSet.add(new PageRanges(1,3));
printerJob.print(printRequestAttributeSet);
Also I try to uppgrade the PDFBox jar 1.8.3 to upcoming jar 2.0.0. I faced a few difficulties (for example: in PDFBox 2.0.0 I'm unable to use the printerJob.setPageable(document);
). Could you please help me to solve this issue.