PDF 2 Tiff conversion is not happening properly
-----------------------------------------------
Key: PDFBOX-771
URL: https://issues.apache.org/jira/browse/PDFBOX-771
Project: PDFBox
Issue Type: Bug
Components: PDFReader
Affects Versions: 1.2.0
Environment: software
Reporter: sri vasu
We are trying to convert PDF to Tiff using the below code, the tiff images are
not coming well (width is shrinking).
PDDocument document = PDDocument.load(pdfFile);
List<PDPage> pages = document.getDocumentCatalog().getAllPages();
for (int i = 0; i < pages.size(); i++) {
BufferedImage image = page.convertToImage(12, 300);
// Convert this image to tiff file.
}
To overcome this problem I modified below code in
'org.apache.pdfbox.util.operator.pagedrawer.Invoke' to adjust the width and
height.
// My page width is always 2479
int imageWidth = awtImage.getWidth();
if(imageWidth > 2479) {
imageWidth = 2479;
}
// My page height is always 3508
int imageHeight = awtImage.getHeight();
if(imageHeight > 3508) {
imageHeight = 3508;
}
Now images are coming fine, it is very slow in processing, not even processing
25 pdfs per hour, also it has memory leaks, it uses lot of resources, it is
killing other process with OutOfMemory errors.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.