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.
Thanks!
CODE:
PdfViewer pdfViewer = new PdfViewer();
pdfViewer.enableScalePrint(false);
pdfViewer.openPdfFile(“C:\TestGwinette.pdf”);
PrinterJob printerJob = PrinterJob.getPrinterJob();
PageFormat pageFormat = printerJob.defaultPage();
pageFormat.setOrientation(PageFormat.PORTRAIT);
pdfViewer.setPrintPageRange(1, pdfViewer.getPageCount());
for (int i = 1; i <= pdfViewer.getPageCount(); i++) {
pdfViewer.setPageFormat(i, pageFormat);
}
printerJob.setPageable(pdfViewer);
printerJob.print();
Hi Joseph,
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.
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 PDFKITJAVA-33271. We
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,
Hi Joseph,
com.aspose.pdf.kit.PdfViewer pdfviewer = new com.aspose.pdf.kit.PdfViewer();<o:p></o:p>
pdfviewer.openPdfFile("c:/pdftest/TestGwinette.pdf");
//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);
pageFormat.setPaper(paper);
//pageFormat.setOrientation(PageFormat.PORTRAIT);
//gets the default page.
PageFormat pf = printJob.defaultPage();
//sets the Paper object for this PageFormat.
//pf.setPaper(paper);
//allows user to edit settings and select printing
printJob.setPrintable(pdfviewer, pf);
//creates the printDialog.
boolean printFile = printJob.printDialog();
if (printFile)
{
printJob.print();
}