Hi, I do not think there are camel-pdf examples, but you can find something useful in the test component https://github.com/apache/camel/tree/main/components/camel-pdf/src/test/java/org/apache/camel/component/pdf most of the Camel tests can be used as reference for your implementation.
Il giorno mar 19 nov 2024 alle ore 12:50 Penagos Jaime < jaime.pena...@ub.uni-muenchen.de> ha scritto: > Hi again everyone, > > is there maybe an example of the working PDF component? Does it map to > PDDocument? Or do I need to use within a processor a manual use of it? > > Again, thanks for any advice on this. > > Best regards, > Jaime P. > > -----Ursprüngliche Nachricht----- > Von: Penagos Jaime <jaime.pena...@ub.uni-muenchen.de> > Gesendet: Montag, 18. November 2024 15:24 > An: 'users@camel.apache.org' <users@camel.apache.org> > Betreff: Apache Camel PDF Component > > Hey everyone, > > I've been testing some camel solr component (v 3.22.2) and I would like to > send to solr the contents of PDF files (that support it), so I decided to > use the PDF Component in Camel and I am not sure how to extract the > information to test. > > > > > Stacktrace > > --------------------------------------------------------------------------------------------------------------------------------------- > org.apache.camel.TypeConversionException: Error during type conversion > from type: org.apache.camel.component.file.GenericFile to the required > type: org.apache.pdfbox.pdmodel.PDDocument with value > GenericFile[myTestPDF.pdf] due to java.lang.IllegalArgumentException: No > serializer found for class org.apache.camel.component.file.FileBinding and > no properties discovered to create BeanSerializer (to avoid exception, > disable SerializationFeature.FAIL_ON_EMPTY_BEANS) (through reference chain: > org.apache.camel.component.file.GenericFile["binding"]) > > > Caused by: java.lang.IllegalArgumentException: No serializer found for > class org.apache.camel.component.file.FileBinding and no properties > discovered to create BeanSerializer (to avoid exception, disable > SerializationFeature.FAIL_ON_EMPTY_BEANS) (through reference chain: > org.apache.camel.component.file.GenericFile["binding"]) > > > > > > From the info I could find on the website, it is focused on the latest > version (4.8), but that's for us not applicable. Is there a way or some > examples that I can refer to to understand what I am supposed to do? > > I appreciate greatly any advice on this. > > > > > My routes look like this > > > > from("file:appdata/etl/odlmu/folder" > + "?" > + "fileName=myTestPDF.pdf" > + "&" > + "noop=true" > ) > .id("route-to-test-components") > .to("pdf:extractText" + "") > .process((Exchange exchange) -> { > }) > .to("file:appdata/etl/odlmu/folder?fileName=myPDFOUTPUT.txt"); > > > > > > Best regards, > Jaime P. >