Hi,
sometimes the conversion of pdf file to png results in an infinite loop and cpu is rising high.
Naturally this is a problem because work is done serverside. Therefore application server must be restarted by our customers.
Is there any solution to avoid this situation?
Is there any possibility to limit the process time analogous to BarCodeReade.setTimeout?
May be is it possible to identify those problematic pdf documents before starting conversion?
Example file for test:
ConvertMe.pdf (7.9 MB)
Source Code:
public static void convertPDFtoImage(Document pdfDocument, String targetImageFileName)
throws IOException
{
Resolution resolution = new Resolution(72);
PngDevice pngDevice = new PngDevice(resolution);
Page page = pdfDocument.getPages().get_Item(1);
java.io.OutputStream imageStream = new java.io.FileOutputStream(targetImageFileName);
pngDevice.process(page, imageStream);
imageStream.close();
}
Kind regards
Matthias