We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Print problems (margins and words incorrect)

I’m trying to print the attached PDF, using the code below. The attached image is the result of the printing (sorry not a great image). Using aspose-pdf-kit 4.0.1 on windows 7.


PdfViewer pdfViewer = new PdfViewer();
PrinterJob printerJob = PrinterJob.getPrinterJob();

PageFormat pageFormat = printerJob.defaultPage();
pdfViewer.setPrintPageRange(1, pdfViewer.getPageCount());
for (int i = 1; i <= pdfViewer.getPageCount(); i++) {
pdfViewer.setPageFormat(i, pageFormat);

Hi Joseph,

Thanks for contacting support.

I have tested the scenario using Aspose.Pdf.Kit for Java 4.4.0 and I am unable to notice any issue. Can you please try using the latest release version and in case you still face the same problem, please feel free to contact.

We are sorry for this inconvenience.

Updated to 4.4.0 appear to have fixed the font crowding issue, but I’m still seeing increased margins from the original. See additional attachments (print-4.4.0-margins and original-margins). In the forums, I see similar issues with the margins with .Net PDF but I’m using Java.

Thanks again,


Hi Joseph,

have tested the scenario and I am able to reproduce the same problem. For the
sake of correction, I have logged it in our issue tracking system as
will investigate this issue in details and will keep you updated on the status
of a correction.

apologize for your inconvenience.

How can I watch progress for the issue? Is the issue tracker public?

Hi Joseph,

Thanks for your inquiry, I'm afraid you can't access or login into Aspose JIRA, our internal issue tracking system. you can only ask us for update status.

Moreover, I have verified your reported issue. It's still not resolved due to some other priority tasks and it’s pending in the queue for analysis. However, I have requested the team for ETA and as soon as I get a feedback I will update you via this forum thread.

Sorry for the inconvenience.

Best Regards,

Any update on this issue? Thanks.

Hi Joseph,

Thanks for your patience.

The development team is still busy in investigating and resolving the earlier stated issue and I am afraid its not yet resolved. Nevertheless, I have again sent an intimation to development team to get any possible ETA regarding its resolution. Please be patient and spare us little time. We are really sorry for this delay and inconvenience.

Hi Joseph,

Thanks for your patience.

We have further investigated the issue and as per our observations, the problem seems to be fixed when using following code snippet with Aspose.Pdf.Kit for Java 4.5.0. For your reference, I have also attached the resultant file being generated over my end. In case the problem still persists or you have any further query, please feel free to contact.


com.aspose.pdf.kit.PdfViewer pdfviewer = new com.aspose.pdf.kit.PdfViewer();<o:p></o:p>


//gets a printjob object.

PrinterJob printJob = PrinterJob.getPrinterJob();

PageFormat pageFormat = printJob.defaultPage();

Paper paper = new Paper();

double margin = 1;

paper.setImageableArea(margin, margin, paper.getWidth() - margin * 2, paper.getHeight()

- margin * 2);



//gets the default page.

PageFormat pf = printJob.defaultPage();

//sets the Paper object for this PageFormat.


//allows user to edit settings and select printing

printJob.setPrintable(pdfviewer, pf);

//creates the printDialog.

boolean printFile = printJob.printDialog();

if (printFile)