PDFBox
  1. PDFBox
  2. PDFBOX-723

Our test hangs with custom pdf file on operation PDPage.convertToImage()

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.7.3, 1.1.0, 1.2.0
    • Fix Version/s: 2.0.0
    • Component/s: None
    • Labels:
      None
    • Environment:
      Linux, JDK 1.5 Update 22 (32 and 64), JDK 1.5 Update 16
      (works with Linux, JDK 1.6 perfect,
      works with MacOS JDK 1.5 update 13)

      Description

      Our code is:

      
            String pdfname = "081111.pdf";
            InputStream pdf = Thread.currentThread().getContextClassLoader().getResourceAsStream(pdfname);
            ContentStream stream = new BaseContentStream(pdf, pdfname, new MimeType("application", "pdf"));
      
            PDDocument pdf = PDDocument.load(stream.getStream());
            PDPage page = (PDPage)pdf.getDocumentCatalog().getAllPages().get(0);
            BufferedImage image = page.convertToImage();
      ...
      
      1. 081111.pdf
        245 kB
        Alexey Zavizionov

        Issue Links

          Activity

          Alexey Zavizionov created issue -
          Hide
          Alexey Zavizionov added a comment -

          The PDF

          Show
          Alexey Zavizionov added a comment - The PDF
          Alexey Zavizionov made changes -
          Field Original Value New Value
          Attachment 081111.pdf [ 12443871 ]
          Alexey Zavizionov made changes -
          Description Our code is:
          {code}
             public RenditionContentStream getRenditionStream(ContentStream stream) throws IOException
             {
                PDDocument pdf = null;
                try
                {
                   pdf = PDDocument.load(stream.getStream());
                   PDPage page = (PDPage)pdf.getDocumentCatalog().getAllPages().get(0);
                   BufferedImage image = page.convertToImage();
          ...
          {code}
          Our code is:
          {code}

                String pdfname = "081111.pdf";
                InputStream pdf = Thread.currentThread().getContextClassLoader().getResourceAsStream(pdfname);
                ContentStream stream = new BaseContentStream(pdf, pdfname, new MimeType("application", "pdf"));

                PDDocument pdf = PDDocument.load(stream.getStream());
                PDPage page = (PDPage)pdf.getDocumentCatalog().getAllPages().get(0);
                BufferedImage image = page.convertToImage();
          ...
          {code}
          Adam Nichols made changes -
          Link This issue is related to PDFBOX-988 [ PDFBOX-988 ]
          Adam Nichols made changes -
          Link This issue is related to PDFBOX-1019 [ PDFBOX-1019 ]
          Adam Nichols made changes -
          Link This issue relates to PDFBOX-1019 [ PDFBOX-1019 ]
          Adam Nichols made changes -
          Link This issue relates to PDFBOX-1019 [ PDFBOX-1019 ]
          Andreas Lehmkühler made changes -
          Priority Blocker [ 1 ] Major [ 3 ]
          Hide
          Andreas Lehmkühler added a comment -

          I can't reproduce the issue, but I guess it is related to the font rendering with different JDK version.

          It looks quite perfect after solving PDFBOX-490 and I assume that convertToImage no longer hangs when processing the attached pdf.

          Show
          Andreas Lehmkühler added a comment - I can't reproduce the issue, but I guess it is related to the font rendering with different JDK version. It looks quite perfect after solving PDFBOX-490 and I assume that convertToImage no longer hangs when processing the attached pdf.
          Andreas Lehmkühler made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Assignee Andreas Lehmkühler [ lehmi ]
          Fix Version/s 2.0.0 [ 12319281 ]
          Resolution Fixed [ 1 ]
          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Resolved Resolved
          1191d 1h 59m 1 Andreas Lehmkühler 09/Aug/13 18:54

            People

            • Assignee:
              Andreas Lehmkühler
              Reporter:
              Alexey Zavizionov
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development