davsclaus opened a new pull request, #31062:
URL: https://github.com/apache/camel/pull/31062

   _Claude Code on behalf of Claus Ibsen_
   
   JIRA: https://issues.apache.org/jira/browse/CAMEL-27751
   
   ## Problem
   
   The fop producer reads the `CamelFop.Render.*` and `CamelFop.Encrypt.*` 
message headers to set the PDF metadata and the encryption settings of each 
document. It passed all such headers to 
`PropertyBindingSupport.bindProperties`, the general purpose binder used for 
endpoint and component configuration. As a result:
   
   - a header value was not always applied as given: text with `{{` `}}`, or a 
value that starts with `#`, was interpreted by the binder (property placeholder 
or reference syntax) instead of being written into the PDF as is;
   - any property of `FOUserAgent` / `PDFEncryptionParams` could be set from a 
header, including object-typed ones (renderer and event handler overrides, 
output file) that are not meant to be configured per message;
   - unknown names were silently ignored.
   
   ## Change
   
   - `FopProducer` maps the supported option names to the `FOUserAgent` and 
`PDFEncryptionParams` setters and converts each value with the Camel type 
converter (`mandatoryConvertTo`), so the value is used as given:
     - `CamelFop.Render.*`: `producer`, `creator`, `author`, `title`, 
`subject`, `keywords`, `creationDate`, `targetResolution`, `accessibility`, 
`pdfUAEnabled`, `keepEmptyTags`, `locatorEnabled`, `conserveMemoryPolicy`;
     - `CamelFop.Encrypt.*`: `userPassword`, `ownerPassword`, `allowPrint`, 
`allowPrintHq`, `allowCopyContent`, `allowEditContent`, `allowEditAnnotations`, 
`allowFillInForms`, `allowAccessContent`, `allowAssembleDocument`, 
`encryptMetadata`, `encryptionLengthInBits`.
   - Option names are matched case-insensitively (`CamelFop.Render.Creator` 
keeps working). Other names are ignored, with a WARN in the log.
   - `CamelFop.RendererOptions.*` is unchanged.
   - `fop-component.adoc` lists all supported headers and says the values are 
used as given; routes that need a placeholder or a bean value resolve it before 
the `fop` endpoint (for example with Simple).
   - Upgrade guide entries for 4.24, and for 4.22.4 and 4.18.7 (on main, as the 
upgrade guides live there).
   
   ## Tests
   
   - `FopMetadataHeadersTest`: metadata headers are written to the PDF (read 
back with PDFBox); values with `{{...}}` or a leading `#` are written exactly 
as given; header names are case-insensitive; an unsupported render header is 
ignored.
   - `FopEncryptionHeadersTest`: the password header opens the PDF exactly as 
given; permission headers (`allowPrint=false`, `allowCopyContent=false`) are 
reflected in the access permissions.
   - `mvn install` in `components/camel-fop`: 20 tests, 0 failures. Full 
reactor `mvn -Dquickly install` passes.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to