PDF & Screenshot
Catalyst SmartBrowz te ofrece el componente PDF & Screenshot para generar tus documentos visuales preferidos a través de código. Puedes incorporar esta funcionalidad en tu aplicación copiando el código a continuación y pegándolo en la lógica de tu aplicación. Utilizando el SDK a continuación, puedes generar documentos visuales usando HTML, URL o Templates como tu entrada. Para conocer más sobre la instancia de componente smart_browz utilizada a continuación, consulta esta sección de ayuda.
smart_browz = app.smart_browz()
result = smart_browz.generate_from_template(
"153000000009001", # Reemplazar el ID de plantilla
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"
}
}
})
En la sección de PDF & Screenshot de la consola, puedes probar directamente este componente usando la funcionalidad Playground, y también puedes copiar el SDK directamente desde la consola.
Última actualización 2026-03-30 13:40:30 +0530 IST
Yes
No
Send your feedback to us