- 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
- create a user action that will trigger the chain
- install Nuxeo 7.10 or later
- create a Document of type File and attach an excel document (i.e. attached file)
- click the user action and download the pdf file
- 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))