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

Free Support Forum - aspose.com

Performance issue about convert pdf to png and add background to pdf using Aspose pdf for Java

Hi,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

There are two processing slow:

1> Convert Pdf file to Png using Aspose pdf for java, the pdf file size is 75.6K, height=793px, width=612px, using the resolution=300(look at the code), convert to image is Height=3300px, Width=2550px, size is 158K. the following code take almose 7s.

PngDevice pngDevice = new PngDevice(imgResolution);

pngDevice.process(page, imageStream); -------- //here take about 7s

2> Add background also take about 10s. the png image is the same as above. The input pdf file size is 75K , added background pdf file size is 250K. both of the pdf file’s height and width is the same as above

Document doc = new Document(pdfFileName);

ImageStamp imageStamp = new ImageStamp(imgFileName);

com.aspose.pdf.Page page = doc.getPages().get_Item(1);

double height = page.getRect().getHeight();

double width = page.getRect().getWidth();

<o:p></o:p>

imageStamp.setHeight(height);

imageStamp.setWidth(width);

page.addStamp(imageStamp); ---- //here take about 10s.

Hi Weinien,


Thanks for your inquiry. We have received another similar query here, so linked your query to the issues logged in that post. We will notify you via this forum thread as soon as these issues are fixed.

We are sorry for the inconvenience caused.

Best Regards,

The issues you have found earlier (filed as PDFNEWJAVA-33910) have been fixed in Aspose.Pdf for Java 11.0.0.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.
(3)