Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-21605

PDF/A-1 parameter is ignored during conversion

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 7.10, 8.10, 9.1-SNAPSHOT
    • Fix Version/s: 7.10-HF22, 8.10-HF01, 9.1
    • Component/s: Convert

      Description

      1. in Studio set up an automated chain like the following:
        - Context.FetchDocument
        - Context.SetVar:
            name: TheDoc
            value: "@{Document.id}"
        - Document.GetBlob:
            xpath: "file:content"
        - Blob.RunConverter:
            converter: any2pdf
            parameters:
              PDF/A-1: "true"
        - WebUI.DownloadFile
        
      2. create a user action that will trigger the chain
      3. install Nuxeo 7.10 or later
      4. create a Document of type File and attach an excel document (i.e. attached file)
      5. click the user action and download the pdf file
      6. the file is not formatted as expected (some part is cut on the right)

      In JODBasedConverter.java:

          public BlobHolder convert(BlobHolder blobHolder, Map<String, Serializable> parameters) throws ConversionException {
              blobHolder = new UTF8CharsetConverter().convert(blobHolder, parameters);
              Blob inputBlob = blobHolder.getBlob();
              String blobPath = blobHolder.getFilePath();
              if (inputBlob == null) {
                  return null;
              }
      
              OfficeDocumentConverter documentConverter = newDocumentConverter();
              // This plugin do deal only with one input source.
              String sourceMimetype = inputBlob.getMimeType();
      
              boolean pdfa1 = parameters != null && Boolean.TRUE.equals(parameters.get(PDFA1_PARAM));
      

      Boolean.TRUE is of type Boolean
      parameters.get(PDFA1_PARAM) returns a String

      This means a comparison between both will always return false.
      On can verify this by issuing the following statement in a debug session:

      Boolean.TRUE.equals("true")

      A fix would be the following:

      boolean pdfa1 = parameters != null && Boolean.TRUE.toString().equals(parameters.get(PDFA1_PARAM))
      

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 3 hours
                3h