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.

...

Warning
  • The API IP/Domain Whitelist setting in General Settings needs to be configured in order for reportLink hash variable to work. If a request is from a non-whitelisted IP/domain, the response will be a HTTP 400 Bad Request.
  • For security purposes, the direct URL parsed from Report Link Hash Variable is dependent on user session (including Anonymous users where the parsed link will differ).
    For example, if user admin obtains the parsed URL and expose it to anonymous users, the link will be invalid.
  • #reportLink.id#ID# - To attach reports in email tool, where ID is the report id.
  • #reportLink.idID[param1=value1&param2=value2]# - To attach reports in email tool with parameters passing.
  • #reportParam.name# - To populate dynamic report parameter values ( for example parameters set in report menu, subreport, etc. ).
  • #reportLink.REPORT_ID[id={form.f1.id}]# - Example of the hash variable used in "Process > Email Tool > Files > Path" to pass the ID to the report builder to attach the PDF into the Email Tool.

Example hash variable:

Code Block
languagexml
#reportLink.rp_report1[id=5c3daa8c-b8e7-4e04-8119-e31be53d6232]#



Download Demo App

...

...