Details

    • Type: Improvement Improvement
    • Status: Closed
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.8.0-incubator
    • Component/s: None
    • Labels:
      None

      Description

      [imported from SourceForge]
      http://sourceforge.net/tracker/index.php?group_id=78314&atid=552834&aid=1773675
      Originally submitted by nobody on 2007-08-14 00:42.

      currently the pdf to image conversion does only work partially. there are a few problems i would like to address with the patch:

      • draw ALL jpeg image which are inlined in the pdf doc.
        some of the jpeg image have some kind of ".Adobe"
        header instead of the "JFIF" header. ImageIO is unable
        to read the jpegs starting with the ".adobe" header.
      • catch a few nullpointer exceptions so that the draw
        "flow" is not interrupted
      • currently the PDType0Font class draws nothing at all,
        resp. throws which breaks as well the draw "flow".
        because i did not know how the type0 font should be
        drawn i simply extended from type1 (which is not cool)
        so that at least text is drawn.

      a lot more pdfs are drawn as images with this changes in a more or less good quality.

      you will find all "touched" files in the attached zip file.

      btw: i did the relying on the "PDFBox-0.7.4-dev-20070716" dev load.

      for any questions send my an email to: philipp.koch@day.com

      [attachment on SourceForge]
      http://sourceforge.net/tracker/download.php?group_id=78314&atid=552834&aid=1773675&file_id=241160
      pdfbox-patch.zip (application/x-zip-compressed), 13219 bytes
      patch

      [comment on SourceForge]
      Originally sent by danielwilson.
      Logged In: YES
      user_id=1737686
      Originator: NO

      This seems to work well – given one more change that Philipp emailed me.

      You need to add this overload of write2file to org\pdfbox\pdmodel\graphics\xobject\PDXObjectImage.java

      /**

      • Writes the image to a file with the filename + an appropriate suffix, like "Image.jpg".
      • The suffix is automatically set by the
      • @param file the file
      • @throws IOException When somethings wrong with the corresponding file.
        */
        public void write2file(File file) throws IOException
        {
        FileOutputStream out = null;
        try { out = new FileOutputStream(file); write2OutputStream(out); out.flush(); }

        finally

        Unknown macro: { if( out != null ) { out.close(); } }

        }

        Activity

        Anonymous created issue -
        Hide
        Jukka Zitting added a comment -

        [Comment on SourceForge]
        Date: 2008-05-15 14:52
        Sender: danielwilson
        Logged In: YES
        user_id=1737686
        Originator: NO

        I have incorporated this as it passes the existing regression tests and
        improves output.

        I saw nothing here for the type0 font issue ... but I think you've given a
        good hint in your writeup.

        Show
        Jukka Zitting added a comment - [Comment on SourceForge] Date: 2008-05-15 14:52 Sender: danielwilson Logged In: YES user_id=1737686 Originator: NO I have incorporated this as it passes the existing regression tests and improves output. I saw nothing here for the type0 font issue ... but I think you've given a good hint in your writeup.
        Jukka Zitting made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Jukka Zitting made changes -
        Fix Version/s 0.8.0-incubator [ 12313346 ]
        Jukka Zitting made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Unassigned
            Reporter:
            Anonymous
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development