I am using the Open source PurePDF library in my Flex AIR application. The problem is performance:
It takes 100% CPU usage and too long to generate a PDF.
-
I have done some analysis on it and
find that the text writing in pdf is
expensive. That’s why I need to know how I
can improve the performance. Are
there any fonts for which pdf
generation is less expensive, or
is there some setting or tip that can make this
process somewhat better in terms of
performance? -
secondly in case of images the ImageElement generation is very expensive when writing that element to PDF. Is there any way to reduce the processing?
Meanwhile, I found a way to reduce the ImageElement generation processing by resizing the image using flex and by then passing the small image’s bitmap data to the image element. It works fine, and i have reduced the time of execution to a good extent. Does anybody else have ideas about other problems?
- is there any way to tell PDF to work in chunks or divide the work in such a way that it may take more time to complete but won’t block the GUI while the PDF is being generated?
Please help — thanks in advance.
The way to optimize the PDF generation with purePDF is to divide the working of purePDF component generation in chunks by creating the components time to time and the major issue resolved by image resizing
As images takes to time to be embed in PDF and the time taken in this processes is directly proportional to image size.
So 1st reduce the size of image and then embed in PDF (Keep in mind if sizes are reduced up to a large scale it will reduce the quality of image very much ) keep experimenting to get the optimum size to have good enough quality and speed for PDF generation.
The last thing is to avoid the transparent images as they need more processing only use transparency if must required otherwise use images with white background .