Uploaded image for project: 'PDFBox'
  1. PDFBox
  2. PDFBOX-4039

StackOverflowError at renderimageWithDPI with the included PDF-Document

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Duplicate
    • None
    • None
    • None
    • None

    Description

      • 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); }

      }
      }

      Attachments

        1. error_log.txt
          2 kB
          Fabio Brandner
        2. Rechnung_W16_001889.pdf
          200 kB
          Fabio Brandner

        Issue Links

          Activity

            People

              Unassigned Unassigned
              fabiobrandner Fabio Brandner
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: