Versions Compared

Key

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

...

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

This code can be used within the form that capture the PDF fields using custom html element

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.

Report Element & Report Properties

...