0

I am facing a situation where the system will receive multiple base64 encoded PDF files from a third party system.

I need to merge those base64 encoded strings into one PDF, by appending the PDF in order and generate a new base64 encoded PDF file in Java.

I found out that I could not just concat multiple base 64 encoded PDF files together to form a new single base 64 encoded PDF.

Is there a way to accomplish this?

How to merge two PDF files into one in Java? does not answer the question because it is not merging multiple base64 encoded PDF files, thank you.

Curry
  • 93
  • 1
  • 9
  • 3
    There's two layers: 1. decode your input PDFs to `byte[]` (or temporary files, if they are big). 2. merge the two PDFs. 3. re-encode the result to Base64. – Joachim Sauer Oct 27 '22 at 08:41
  • @JoachimSauer Thank you for providing the general direction on how to handle it. – Curry Oct 27 '22 at 09:22

0 Answers0