Images help to make PDF printouts visually appealing. The Layout Manager provides simple ways to add images to the report layout and optimizes image quality during report generation. PNG and JPG are the only two supported image types and accepted file extensions include PNG, WEBP, JPG, and JPEG.
In this tutorial you will learn how to:
•Use static images
•Integrate dynamic images via parameters
1. Use static images
Let's take the example of a company letter. It will usually contain your company logo in the header or footer on each page of the printout. The image is represented as static data - it doesn't change depending on the data included in the report.
Adding a static image to your report layout is as easy as uploading it to the report directly. Once added you can adjust its size, position it and apply styles as you need.
2. Integrate dynamic images via parameters
For most of your use cases you'll need to print an image based on the underlying data. Let's take a data sheet of an employee as example. You have multiple employees, each represented with some personal data and a picture.
In such a case you'll have a list of parameters. Each parameter needs a data type - image is the data type for the picture.
When you pass image parameters from your application, you have to provide base64 encoded images as string. The string must contain the following format:
data:image/<image type>;base64,<encoded image data>
<image type> must either be "png", "webp", "jpg" or "jpeg".
<encoded image data> contains the base64 encoded image data.