Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"headers": {
"CamelPdfProtectionPolicy": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "org.apache.pdfbox.pdmodel.encryption.ProtectionPolicy", "deprecated": false, "autowired": false, "secret": false, "description": "Expected type is https:\/\/pdfbox.apache.org\/docs\/2.0.13\/javadocs\/org\/apache\/pdfbox\/pdmodel\/encryption\/ProtectionPolicy.html[ProtectionPolicy]. If specified then PDF document will be encrypted with it.", "constantName": "org.apache.camel.component.pdf.PdfHeaderConstants#PROTECTION_POLICY_HEADER_NAME" },
"CamelPdfDocument": { "index": 1, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "org.apache.pdfbox.pdmodel.PDDocument", "deprecated": false, "autowired": false, "secret": false, "description": "Mandatory* header for append operation and ignored in all other operations. Expected type is https:\/\/pdfbox.apache.org\/docs\/2.0.13\/javadocs\/org\/apache\/pdfbox\/pdmodel\/PDDocument.html[PDDocument]. Stores PDF document which will be used for append operation.", "constantName": "org.apache.camel.component.pdf.PdfHeaderConstants#PDF_DOCUMENT_HEADER_NAME" },
"CamelPdfDecryptionMaterial": { "index": 2, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "org.apache.pdfbox.pdmodel.encryption.DecryptionMaterial", "deprecated": false, "autowired": false, "secret": false, "description": "Expected type is https:\/\/pdfbox.apache.org\/docs\/2.0.13\/javadocs\/org\/apache\/pdfbox\/pdmodel\/encryption\/DecryptionMaterial.html[DecryptionMaterial]. Mandatory* header if PDF document is encrypted.", "constantName": "org.apache.camel.component.pdf.PdfHeaderConstants#DECRYPTION_MATERIAL_HEADER_NAME" },
"CamelPdfDecryptionMaterial": { "index": 2, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "org.apache.pdfbox.pdmodel.encryption.DecryptionMaterial", "deprecated": true, "deprecationNote": "No longer read by the component since Camel 2.21: PDFBox 2 decrypts at load time via Loader.loadPDF(bytes, password). The byte[] converter loads without a password. Decrypt in a Processor before the PDF endpoint instead.", "autowired": false, "secret": false, "description": "Expected type is https:\/\/pdfbox.apache.org\/docs\/2.0.13\/javadocs\/org\/apache\/pdfbox\/pdmodel\/encryption\/DecryptionMaterial.html[DecryptionMaterial]. Deprecation note: No longer read by the component since Camel 2.21: PDFBox 2 decrypts at load time via Loader.loadPDF(bytes, password). The byte[] converter loads without a password. Decrypt in a Processor before the PDF endpoint instead.", "constantName": "org.apache.camel.component.pdf.PdfHeaderConstants#DECRYPTION_MATERIAL_HEADER_NAME" },
"CamelPdfFilesToMerge": { "index": 3, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "java.util.List<java.lang.Object>", "deprecated": false, "autowired": false, "secret": false, "description": "Mandatory* header for merge operation and ignored in all other operations. The list of pdf files that will be merged, each given as a java.io.File or a java.nio.file.Path.", "constantName": "org.apache.camel.component.pdf.PdfHeaderConstants#FILES_TO_MERGE_HEADER_NAME" }
},
"bodyTypes": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"headers": {
"CamelPdfProtectionPolicy": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "org.apache.pdfbox.pdmodel.encryption.ProtectionPolicy", "deprecated": false, "autowired": false, "secret": false, "description": "Expected type is https:\/\/pdfbox.apache.org\/docs\/2.0.13\/javadocs\/org\/apache\/pdfbox\/pdmodel\/encryption\/ProtectionPolicy.html[ProtectionPolicy]. If specified then PDF document will be encrypted with it.", "constantName": "org.apache.camel.component.pdf.PdfHeaderConstants#PROTECTION_POLICY_HEADER_NAME" },
"CamelPdfDocument": { "index": 1, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "org.apache.pdfbox.pdmodel.PDDocument", "deprecated": false, "autowired": false, "secret": false, "description": "Mandatory* header for append operation and ignored in all other operations. Expected type is https:\/\/pdfbox.apache.org\/docs\/2.0.13\/javadocs\/org\/apache\/pdfbox\/pdmodel\/PDDocument.html[PDDocument]. Stores PDF document which will be used for append operation.", "constantName": "org.apache.camel.component.pdf.PdfHeaderConstants#PDF_DOCUMENT_HEADER_NAME" },
"CamelPdfDecryptionMaterial": { "index": 2, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "org.apache.pdfbox.pdmodel.encryption.DecryptionMaterial", "deprecated": false, "autowired": false, "secret": false, "description": "Expected type is https:\/\/pdfbox.apache.org\/docs\/2.0.13\/javadocs\/org\/apache\/pdfbox\/pdmodel\/encryption\/DecryptionMaterial.html[DecryptionMaterial]. Mandatory* header if PDF document is encrypted.", "constantName": "org.apache.camel.component.pdf.PdfHeaderConstants#DECRYPTION_MATERIAL_HEADER_NAME" },
"CamelPdfDecryptionMaterial": { "index": 2, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "org.apache.pdfbox.pdmodel.encryption.DecryptionMaterial", "deprecated": true, "deprecationNote": "No longer read by the component since Camel 2.21: PDFBox 2 decrypts at load time via Loader.loadPDF(bytes, password). The byte[] converter loads without a password. Decrypt in a Processor before the PDF endpoint instead.", "autowired": false, "secret": false, "description": "Expected type is https:\/\/pdfbox.apache.org\/docs\/2.0.13\/javadocs\/org\/apache\/pdfbox\/pdmodel\/encryption\/DecryptionMaterial.html[DecryptionMaterial]. Deprecation note: No longer read by the component since Camel 2.21: PDFBox 2 decrypts at load time via Loader.loadPDF(bytes, password). The byte[] converter loads without a password. Decrypt in a Processor before the PDF endpoint instead.", "constantName": "org.apache.camel.component.pdf.PdfHeaderConstants#DECRYPTION_MATERIAL_HEADER_NAME" },
"CamelPdfFilesToMerge": { "index": 3, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "java.util.List<java.lang.Object>", "deprecated": false, "autowired": false, "secret": false, "description": "Mandatory* header for merge operation and ignored in all other operations. The list of pdf files that will be merged, each given as a java.io.File or a java.nio.file.Path.", "constantName": "org.apache.camel.component.pdf.PdfHeaderConstants#FILES_TO_MERGE_HEADER_NAME" }
},
"bodyTypes": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,12 @@ public final class PdfHeaderConstants {
public static final String PDF_DOCUMENT_HEADER_NAME = "CamelPdfDocument";
@Metadata(description = """
Expected type is
https://pdfbox.apache.org/docs/2.0.13/javadocs/org/apache/pdfbox/pdmodel/encryption/DecryptionMaterial.html[DecryptionMaterial].
*Mandatory* header if PDF document is encrypted.""",
javaType = "org.apache.pdfbox.pdmodel.encryption.DecryptionMaterial")
https://pdfbox.apache.org/docs/2.0.13/javadocs/org/apache/pdfbox/pdmodel/encryption/DecryptionMaterial.html[DecryptionMaterial].""",
javaType = "org.apache.pdfbox.pdmodel.encryption.DecryptionMaterial",
deprecationNote = "No longer read by the component since Camel 2.21: PDFBox 2 decrypts at load time"
+ " via Loader.loadPDF(bytes, password). The byte[] converter loads without a password."
+ " Decrypt in a Processor before the PDF endpoint instead.")
@Deprecated
public static final String DECRYPTION_MATERIAL_HEADER_NAME = "CamelPdfDecryptionMaterial";

@Metadata(description = """
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
import org.apache.pdfbox.io.RandomAccessReadBuffer;
import org.apache.pdfbox.pdmodel.PDDocument;
import org.apache.pdfbox.pdmodel.encryption.AccessPermission;
import org.apache.pdfbox.pdmodel.encryption.StandardDecryptionMaterial;
import org.apache.pdfbox.pdmodel.encryption.StandardProtectionPolicy;
import org.apache.pdfbox.text.PDFTextStripper;
import org.junit.jupiter.api.Test;
Expand Down Expand Up @@ -104,7 +103,6 @@ public void testAppendEncrypted() throws Exception {

Map<String, Object> headers = new HashMap<>();
headers.put(PdfHeaderConstants.PDF_DOCUMENT_HEADER_NAME, encryptedDocument);
headers.put(PdfHeaderConstants.DECRYPTION_MATERIAL_HEADER_NAME, new StandardDecryptionMaterial(userPass));

resultEndpoint.setExpectedMessageCount(1);
resultEndpoint.expectedMessagesMatches(new Predicate() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import org.apache.pdfbox.Loader;
import org.apache.pdfbox.pdmodel.PDDocument;
import org.apache.pdfbox.pdmodel.encryption.AccessPermission;
import org.apache.pdfbox.pdmodel.encryption.StandardDecryptionMaterial;
import org.apache.pdfbox.pdmodel.encryption.StandardProtectionPolicy;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.io.TempDir;
Expand Down Expand Up @@ -79,10 +78,7 @@ public void testExtractTextFromEncrypted() throws Exception {
PDDocument encryptedDocument = Loader.loadPDF(output.toByteArray(), userPass);

expectText();
template.sendBodyAndHeader("direct:start",
encryptedDocument,
PdfHeaderConstants.DECRYPTION_MATERIAL_HEADER_NAME,
new StandardDecryptionMaterial(userPass));
template.sendBody("direct:start", encryptedDocument);
resultEndpoint.assertIsSatisfied();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9343,6 +9343,27 @@ the permission with `CamelKeycloakPermissionId`

Each is now deprecated, with a `deprecationNote` carrying the same information.

=== camel-pdf - the CamelPdfDecryptionMaterial header is deprecated

The `CamelPdfDecryptionMaterial` header has had no effect since Camel 2.21. PDFBox 2 decrypts a document when it is
loaded, from the password argument of `Loader.loadPDF`, so the producer was changed to stop calling the removed
`PDDocument.openProtection(DecryptionMaterial)` and has not read the header since. A route that sets it gets no error
and no decryption.

It is now deprecated, with a `deprecationNote` that says so. Remove the header and load the document with its password
before it reaches the endpoint, in a `Processor`:

[source,java]
----
from("direct:start")
.process(e -> e.getMessage().setBody(
Loader.loadPDF(e.getMessage().getBody(byte[].class), "secret")))
.to("pdf:extractText");
----

The `byte[]` type converter of the component loads without a password, so an encrypted PDF sent as bytes still has to be
loaded this way.

=== camel-docker - the loggingFilter and followRedirectFilter options are deprecated

Neither option has had any effect since Camel 2.18, when the docker-java 3.x upgrade removed the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ public String pdfDocument() {
}
/**
* Expected type is
* https://pdfbox.apache.org/docs/2.0.13/javadocs/org/apache/pdfbox/pdmodel/encryption/DecryptionMaterial.html[DecryptionMaterial]. Mandatory* header if PDF document is encrypted.
* https://pdfbox.apache.org/docs/2.0.13/javadocs/org/apache/pdfbox/pdmodel/encryption/DecryptionMaterial.html[DecryptionMaterial]. Deprecation note: No longer read by the component since Camel 2.21: PDFBox 2 decrypts at load time via Loader.loadPDF(bytes, password). The byte[] converter loads without a password. Decrypt in a Processor before the PDF endpoint instead.
*
* The option is a: {@code
* org.apache.pdfbox.pdmodel.encryption.DecryptionMaterial} type.
Expand All @@ -440,6 +440,7 @@ public String pdfDocument() {
*
* @return the name of the header {@code PdfDecryptionMaterial}.
*/
@Deprecated
public String pdfDecryptionMaterial() {
return "CamelPdfDecryptionMaterial";
}
Expand Down
Loading