Hello, I have a pdf file, want to convert to png, but got out of memery error, can you help me solve it.
my code:
Document pdfDocument = new Document(pdfPath);
Resolution resolution = new Resolution(80);
PngDevice pngDevice = new PngDevice(resolution);
for (int i = 0; i < pdfDocument.getPages().size(); i++) {
String tmpPng = filePrefix + "/" + (i + 1) + ".png";
java.io.OutputStream outputBinImageFile = new java.io.FileOutputStream(tmpPng);
pngDevice.process(pdfDocument.getPages().get_Item(i + 1), outputBinImageFile);
outputBinImageFile.close();
}
pdfDocument.close();