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.
To know more about the component instance smart_browz used below, please refer to this help section.
smart_browz = app.smart_browz()
result = smart_browz.generate_from_template(
"153000000009001", # Replace template id
template_data={},
output_options={"output_type": "pdf"},
pdf_options={
"scale": 1,
"display_header_footer": true,
"print_background": false,
"landscape": false,
"page_ranges": "1",
"format": "A4",
"width": "100",
"height": "100",
"omit_background": false,
"password": "Demo$",
},
page_options={
"css": {"content": "body{background: lightgrey}"},
"viewport": {"width": 1440, "height": 900},
"javascript_enabled": true,
},
navigation_options={"timeout": 5000, "wait_until": "networkidle0"},
)
smart_browz = app.smart_browz()
result = smart_browz.convert_to_pdf(
"",
pdf_options={
"scale": 1,
"display_header_footer": true,
"print_background": false,
"landscape": false,
"page_ranges": "1",
"format": "A4",
"width": "100",
"height": "100",
"omit_background": false,
"password": "Demo$",
},
page_options={
"css": {"content": "body{background: lightgrey}"},
"viewport": {"width": 1440, "height": 900},
"javascript_enabled": true,
},
navigation_options={"timeout": 5000, "wait_until": "networkidle0"},
)
smart_browz = app.smart_browz()
result = smart_browz.convert_to_pdf(
"https://catalyst.zoho.com/",
pdf_options={
"scale": 1,
"display_header_footer": true,
"print_background": false,
"landscape": false,
"page_ranges": "1",
"format": "A4",
"width": "100",
"height": "100",
"omit_background": false,
"password": "Demo$",
},
page_options={
"css": {"content": "body{background: lightgrey}"},
"viewport": {"width": 1440, "height": 900},
"javascript_enabled": true,
},
navigation_options={"timeout": 5000, "wait_until": "networkidle0"},
)
smart_browz = app.smart_browz()
output_screenshot = smart_browz.take_screenshot(
source='',
"output_options": {
"output_type": "screenshot"
},
screenshot_options= {
"type": "jpeg",
"quality": 100,
"full_page": false,
"omit_background": false,
"capture_beyond_viewport": true,
"clip": {
"x": 50,
"y": 100,
"width": 1000,
"height": 100
}
},
page_options= {
"css": {
"content": "body{background: lightgrey}"
},
"viewport": {
"width": 1440,
"height": 900
"viewport": {
"width": 1440,
"height": 900
},
"javascript_enabled": true
"javascript_enabled": true
},
navigation_options= {
"timeout": 5000,
"wait_until": "networkidle0"
"navigation_options": {
"timeout": 5000,
"wait_until": "networkidle0"
}
}
})
smart_browz = app.smart_browz()
output_screenshot = smart_browz.take_screenshot(
source='YOUR_URL',
"output_options": {
"output_type": "screenshot"
},
screenshot_options= {
"type": "jpeg",
"quality": 100,
"full_page": false,
"omit_background": false,
"capture_beyond_viewport": true,
"clip": {
"x": 50,
"y": 100,
"width": 1000,
"height": 100
}
},
page_options= {
"css": {
"content": "body{background: lightgrey}"
},
"viewport": {
"width": 1440,
"height": 900
"viewport": {
"width": 1440,
"height": 900
},
"javascript_enabled": true
"javascript_enabled": true
},
navigation_options= {
"timeout": 5000,
"wait_until": "networkidle0"
"navigation_options": {
"timeout": 5000,
"wait_until": "networkidle0"
}
}
})
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-12-16 10:31:39 +0530 IST
Yes
No
Send your feedback to us