Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-21026

camel-pdf: simplify conversion from byte array to PDF

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 4.7.0
    • 4.8.0
    • camel-pdf
    • None
    • Unknown

    Description

      When receiving a PDF document as a byte array, users need to convert the data manually to a PDF document. For instance, consider a route like:

          from("direct:consumePDF")
                      .process(this::convertBytesToPDFFile) // -> this is needed to convert
                      .pipeline()
                          .to("pdf:extractText")
                          .process(...);
      

      Then, the convertBytesToPDFFile should contain something like:

      final byte[] body = e.getMessage().getBody(byte[].class);
      
      PDDocument document = Loader.loadPDF(body);
      

      This makes designing routes that consume PDFs harder.

      Attachments

        Issue Links

          Activity

            People

              orpiske Otavio Rodolfo Piske
              orpiske Otavio Rodolfo Piske
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: