Quite new to Aspose API. Can anybody kindly point out why the following two pieces of code take so long to complete? Anything could be done to improve the processing time?
The code running under RHEL 6.4 X86-64 on a Dell P/E Server with JDK 1.7 with dual Xeon CPU of 8 cores and 16GB RAM.
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 almost 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 files height and width are 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();
page.addStamp(imageStamp); <---- //here take about 10s.