We know that we can create PDFs and Images using Base64 Data, we can generate PDFs only if we have a valid Base64 content which includes, PDF format like Borders, Fonts, Style along with Data. Even if a small character is missed in Base64 content, you won’t be able to generate a PDF.

In short, you should have a valid base64 to generate PDFs using Mule 4.

There’s no option to generate a PDF by providing Custom Data as input in Mule Application.

But still, Mule helps you to allow you to write a Java code and make use of it in your API.

Requirements

  • We need an external Jar: iTextPdf
  • Custom Java Code
  • Java connector to invoke Java class

Step One

Add below dependency into your pom before writing your Java code. So that you can import the classes while writing Java code

Java

1

<dependency>

2

    <groupId>com.itextpdf</groupId>

3

    <artifactId>itextpdf</artifactId>

4

    <version>5.5.13.1</version>

5

</dependency>

#tutorial #integration #mulesoft #mule 4 #mulesoft 4 #custom data #java code

Creating PDF's With Custom Data Using Mule 4+ Java
9.30 GEEK