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

Adding XMP data to a PDF causes different kinds of mutilations of the original pdf.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Invalid
    • 0.7.3
    • None
    • Writing
    • Windows XP

    Description

      We are using PdfBox for a Material Workflow application for one of the major Newspaper publishers in the Netherland.
      One of the things we use PdfBox for is adding MMP data to the XML file.
      Doing this causes different kinds of mutilation of the original pdf.

      The way in which this occurs varies. Sometimes a character is altered, sometimes an element or complete ad is mutilated, sometimes the color of/in an ad is changed.
      These files also tend crash Adobe Acrobat (Professional 9, with Pitstop Professional) (not all files);
      The files also may create a "Failed to open PDF file" when trying to place it InDesign (not all files).

      We use the following source in out application:

      InputStream pdfStream = Core.getFileDocumentContent(pdfFileDocument.getMendixObject());
      PDDocument pdfDoc = PDDocument.load(pdfStream);
      PDDocumentInformation pdfInfo = pdfDoc.getDocumentInformation();

      IMendixObject materiaalMetaMendixObject = xmpDocument.getMendixObject();
      Set<String> memberKeys = materiaalMetaMendixObject.getMembers().keySet();
      for (String memberKey : memberKeys) {
      Object member = materiaalMetaMendixObject.getMember(memberKey).getValue();
      if (member!= null)

      { String memberString = member.toString(); if (memberKey.startsWith("XMP")) pdfInfo.setCustomMetadataValue(memberKey, memberString); }

      }
      pdfDoc.setDocumentInformation(pdfInfo);

      pdfDoc.save(pdfOutputPath + File.separator + fileName);
      pdfDoc.close();
      pdfStream.close();

      Please HELP

      Attachments

        1. Examples Pdf Mutilations.jpg
          141 kB
          Rene Smit

        Activity

          People

            lehmi Andreas Lehmkühler
            timsener Rene Smit
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: