Generate Visual Documents with Templates as SourceAdmin Scope
-
Ensure you have installed the required package to use this SDK method.
-
Any browser action or operation that you code using the Browser Logic function, or any browser automation or web scraping task that you perform using any component of Catalyst SmartBrowz is at your own risk. We strongly recommend that you use the SmartBrowz components to perform operations on domains that permit the actions, or with proper approval.
Additionally, while Catalyst does provide a secure infrastructure to code your functions, any consequence of the logic you code using Catalyst functions is yours alone.
Templates is a Catalyst SmartBrowz component that allows you to design custom HTML blueprints using LiquidJS components to handle dynamic data.
Using the generateFromTemplate() SDK method you can generate the required visual document as per your requirement. The SDK method also allows you to implement multiple customization options including page orientation, size, password protection, and so much more. The required template is referred to using its Template ID.
The smartbrowz reference used in the code snippets below is the component instance created to perform these operations.
const result = await smartbrowz.generateFromTemplate("2075000000021001", {
pdf_options: {
display_header_footer: true,
format: "A1",
height: "100",
width: "100",
landscape: true,
page_ranges: "1-2",
scale: 1.0,
password: "****123" // Add password after enabling the template password setting from the console
},
page_options: {
css: { content: "body { font-size: 12px; }" },
javascript_enabled: true,
viewport: {
height: 800,
width: 600
},
device: "Blackberry PlayBook"
},
navigation_options: {
timeout: 30000,
wait_until: "domcontentloaded"
},
output_options: {
output_type: "pdf"
},
template_data: {}
});
console.log("result::", result);
Last Updated 2026-07-02 14:51:41 +0530 IST
Yes
No
Send your feedback to us