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

Free Support Forum - aspose.com

Borderless pdf print

Java Platform

Hello:

I am currently evaluating Aspose.Pdf.Kit for Java to do background pdf print. Took your sample code BackgroundPrint.java and uncommented borderless section but the page is printed with margin.

Code #1 - doesn't work
//A4 bordless
paper.setSize(595, 842);
paper.setImageableArea(0, 0, 595, 842);

Code #2 - doesn't work.
paper.setImageableArea(0, 0, paper.getWidth(), paper.getHeight());

I tried with both 3.0.0 and 2.9.0 version both has same problem. Let me know if you have any workaround for this problem. Also can you let me know where can I get list of known issues and unsupported features for printing pdf.

Thanks,
Venkat

Hi Venkat,

Can you please share a sample input PDF file with us along with a little bit explanation of the issue? We’ll try to test the issue at our end using your scenario.

We’re sorry for the inconvenience.
Regards,

Hello:

Thanks for the quick response. Attached the input pdf, output pdf and sample Java program I tried.

Hope this helps.

Thanks,
Venkat

Hi Venkat,

I have tested this issue at my end and noticed that a small change in the code is required to put the setImageableArea method to work. Please have a look at the following code:


//sets the page format for each page between startPage and endPage.

for(int page = startPage; page < endPage + 1; page++)

pdfviewer.setPageFormat(page,pf);

If you notice the for loop, the ‘great than’ sign is used, however the sign should be ‘less than’. The result looks better this way. Please give it a try at your end. If it still doesn’t resolve your issue then please do let us know.

We’re sorry for the inconvenience.
Regards,

Thanks. That works. I have an another issue, will post in separate thread.