Hi folks,
As part of our requirement, we need to generate a letterhead in PDF format. The PDF should include the following:
Header with the company logo and details — essentially two images: • Left: address & UEN • Right: company logo
Standard document content with some dynamic fields (e.g., name, email address, reference numbers).
A data table containing business information. The number of rows is dynamic (i.e., the table may have 1, 2, or n rows).
I’ve been exploring smart services that can generate a PDF with all these elements — images (for the header), dynamic text fields, and dynamic table rows. From my research, these two smart services from the Dynamic Document Generator Plug-in seem relevant:
HTML to PDF
XSL-FO to PDF
However, from what I understand, HTML to PDF may not fully support images (I’m not entirely sure, this seems to be a gray area). And I’m not very familiar with how to use XSL-FO for this type of transformation.
It would be really helpful if anyone could share documentation, examples, or best practices for using these smart services, especially around structuring the XML, building the XSL, and handling dynamic tables and images.
Any guidance would be greatly appreciated!
Thanks!
Discussion posts and replies are publicly visible
Use HTML to PDF smart service:Images work - Use base64-encoded images or UrlsBuild HTML string with: Header: <img src="data:image/png;base64,YOUR_BASE64"> for logosBody: Dynamic text fieldsTable: Loop through data to generate <tr> rowsPass HTML string to smart serviceXSL-FO is overkill for this : stick with HTML.
Hey Shubham Aware
Thanks for the response
Sure let me try the base64 way if it works