The printed PDF file is different from the original PDF file.

I am using a PDFBox 1.8.3 jar to print a PDF file in a printer (HW). I printed the PDF file in the usual manner and in the normal mode. When I print a PDF using the usual method, I received the original pdf file as a printed document. But when I use my code, I can not get the source pdf file as printed output. I see a couple of changes in the print file; for example, alignment, 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); 

I am also trying to raise the value of jpg 1.8B in the PDFBox to the upcoming jar 2.0.0. I ran into several difficulties (for example: in PDFBox 2.0.0 I cannot use printerJob.setPageable(document); ). Could you help me solve this problem.

+6
source share
2 answers

This is sometimes associated with the printer. Please try a different printer just to check.

0
source

You can see the answer below the question on StackOverflow and you can use excerpts from the explanation.

How to Define Artificial Bold Style, Artificial Italic Style, and Artificial Contour Text Style Using PDFBOX

Also, make sure that the fonts that come in the original PDF are also present in the container in which the application is running.

Shishir

0
source

All Articles