Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

When generating a PDF report in Joget, you can use server-side scripts (e.g., Groovy or Java) to convert binary data to Base64 before embedding it in the PDF. This can be part of the PDF generation process

Example:
Code Block
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Base64;

// Read binary data from the image file
byte[] imageData = Files.readAllBytes(Path.of("path/to/your/image.jpg"));

// Convert binary data to Base64
String base64ImageData = Base64.getEncoder().encodeToString(imageData);

// Now you can use 'base64ImageData' for embedding in the PDF

...

Note
  • Always consider the size and efficiency of handling large amounts of data, especially when converting binary data to Base64.
  • Be aware that Base64 encoding can increase the size of the data.

Ensure that you adapt the code to your specific use case, and consult Joget's documentation or community forums for the latest information and best practices.

...