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

Broken PDF after load and save

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.0.18, 3.0.0 PDFBox
    • Fix Version/s: None
    • Component/s: Parsing, Writing
    • Labels:
      None

      Description

      If read was done using WINDOWS-1252 charset and writing is done using
      UTF-8 then resulting PDF will be broken after load and save operations.

      PDDocument document = PDDocument.load(sourcePath);
      document.save(targetPath);

      If source PDF contains XObject dictionary reference whose name isn't
      encoded in UTF-8. For example.

      /L#f8vetann 16 0 R

      That is read using WINDOWS-1252 encoding. Now if write operation is
      using UTF-8 then the resulting name will be

      /L#3Fvetann 16 0 R

      And resulting PDF is broken and image is missing.

      FIX in pull request: https://github.com/apache/pdfbox/pull/77

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                oikku Matti Oinas
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated: