This tutorial will show you how to convert a Base64 String to a PDF. Base64 content is needed to create a PDF. To show you how to do it, I converted a PDF file to Base64. I used the URL below for the conversion. I then used the same base64 content to write the PDF to a local directory using the file write operation.
PDF to Base64 Encode – Online Tool
In Anypoint Studio, create a project and set up the listener to start the flow.
To convert the base64 material to PDF, write the dataweave expression.
%dw 2.0import * from dw::core::Binariesoutput multipart/form-data---{ parts: { base64Content: { headers: { "Content-Type": "application/pdf" }, content: fromBase64(payload) }, }} 
Change the mime type to application/pdf

Use the file write procedure to write the file to one of the local directories.

Install and launch the file; a PDF is generated in the local directory.

Git Repositories : sandy551/base64-string-to-pdf (github.com)
We appreciate you taking the time to read the aforementioned post. I hope it was helpful to you. Please leave a remark below if you have any questions. I’d be pleased to look into your suggestions if you’re really interested in learning more about a particular subject.
You can follow us on LinkedIn to receive information on any new postings or updates on our website. I’m excited to interact with you there.
