Versions Compared

Key

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

...

Joget PDF generation is only performed on the server-side, hence any JavaScript will not be executed because JavaScript is only executed on the client-side browser.
This means you cannot use JavaScript to modify the HTML for PDF. You will need a different approach where the form HTML modification is performed entirely on the server-side.
Ensure that your data source in Joget contains fields for image URLs or binary data, depending on how your images are stored. Should there are any need to run JavaScript, please do so on the server-side.

1. Ability to Run JavaScript:

Web View:

  • JavaScript can be executed in the web view as it runs in the browser. You can use JavaScript to manipulate the DOM, handle user interactions, and perform various client-side tasks.

PDF Generated Report:

  • PDFs typically do not execute JavaScript. Therefore, if your web view relies heavily on client-side JavaScript for dynamic behavior, those aspects may not be reflected in a static PDF generated from the same data.

2. Image Handling, PDF Parser, and URL Calls:

Web View:

  • In the web view, you can directly include images using HTML <img> tags or dynamically load them using JavaScript. If images are hosted externally, the browser will make URL calls to fetch them.

PDF Generated Report:

  • To include images in a PDF generated report, you need to handle the image data server-side. If the images are hosted externally, you may need to fetch them using a PDF generation library compatible with Joget. The process involves downloading the image data, embedding it in the PDF, and setting up the report layout.

3. Convert to Base64 to Prevent Server Call:

Web View:

  • In a web view, you can convert binary data (such as images) to Base64 directly in the client-side code. This can be useful for reducing server calls and improving performance.

PDF Generated Report:

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

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

...