PDF & Screenshot
Catalyst SmartBrowz offers you the PDF & Screenshot component to generate your prefered visual docuemnts through code. You can incorporate this functionality in your application by copying the code below and pasting it in your application logic.
Using the SDK below, you can generate visual documents by using HTML, URL or Templates as your input.
Generate Visual Documents Using Template
const smartbrowz = app.smartbrowz();
let 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);
Generate PDF From HTML
const smartbrowz = app.smartbrowz();
let result = await smartbrowz.convertToPdf("HI",
{
"pdf_options": {
'display_header_footer': true,
'footer_template': 'Page Header',
'margin': {
'bottom': '20',
'left': '10',
'right': '10',
'top': '20'
},
'height': '100',
'width': '100',
'landscape': true,
'page_ranges': '1-2',
'scale': 1.0,
'password': 'Siva123'
},
"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'
}
});
console.log(‘result::’, result);
Generate Screenshot from URL
const smartbrowz = app.smartbrowz();
let result = await smartbrowz.convertToPdf("https://www.google.com",
{
"pdf_options": {
'display_header_footer': true,
'footer_template': 'Page Header',
'margin': {
'bottom': '20',
'left': '10',
'right': '10',
'top': '20'
},
'height': '100',
'width': '100',
'landscape': true,
'page_ranges': '1-2',
'scale': 1.0,
'password': 'Siva123'
},
"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'
}
});
console.log(‘result::’, result);
In the PDF & Screenshot section of the console, you can directly test this component using the Playground feature, and you can also copy the SDK directly from the console.
Last Updated 2025-07-07 22:11:41 +0530 IST
Yes
No
Send your feedback to us