[ 
https://issues.apache.org/jira/browse/PDFBOX-4039?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16292737#comment-16292737
 ] 

Tilman Hausherr edited comment on PDFBOX-4039 at 1/4/18 5:40 PM:
-----------------------------------------------------------------

That is because n0 (at 
Root/Pages/Kids/\[0]/Annots/\[0]/AP/N/Resources/XObject/FRM/Resources/XObject/n0)
 is the same object as 
Root/Pages/Kids/\[0]/Annots/\[0]/AP/N/Resources/XObject/FRM. You have a 
recursion in your PDF. You should also report this to PDFsharp. -The signature 
is not up to the standard.- (previous sentence crossed out per comment by mkl 
in PDFBOX-3198)

Fixing this is tricky... we don't store the recursion level anywhere.


was (Author: tilman):
That is because n0 (at 
Root/Pages/Kids/\[0]/Annots/\[0]/AP/N/Resources/XObject/FRM/Resources/XObject/n0)
 is the same object as 
Root/Pages/Kids/\[0]/Annots/\[0]/AP/N/Resources/XObject/FRM. You have a 
recursion in your PDF. You should also report this to PDFsharp. The signature 
is not up to the standard.

Fixing this is tricky... we don't store the recursion level anywhere.

> StackOverflowError at renderimageWithDPI with the included PDF-Document
> -----------------------------------------------------------------------
>
>                 Key: PDFBOX-4039
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-4039
>             Project: PDFBox
>          Issue Type: Bug
>            Reporter: Fabio Brandner
>            Priority: Minor
>         Attachments: Rechnung_W16_001889.pdf, error_log.txt
>
>
> * Error Log in attachment
> * Code: 
>  
> import java.awt.image.BufferedImage;
> import java.io.File;
> import org.apache.pdfbox.pdmodel.PDDocument;
> import org.apache.pdfbox.rendering.ImageType;
> import org.apache.pdfbox.rendering.PDFRenderer;
> import org.junit.Test;
> import play.Environment;
> public class Pdf2Image2 {
> @Test
> public void MyTest() throws Exception {
> Environment environment = Environment.simple();
> File pdfFile = 
> environment.getFile("/test/resources/qrcodes-in-receipts/Rechnung_W16_001889.pdf");
> final PDDocument document = PDDocument.load(pdfFile);
> for (int page = 0; page < document.getNumberOfPages(); ++page)
> { int thePage = page; BufferedImage bim; PDFRenderer pdfRenderer = new 
> PDFRenderer(document); bim = pdfRenderer.renderImageWithDPI(thePage, 400, 
> ImageType.RGB); System.out.println(bim); }
> }
> }



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to