---
title: "PDF \u0026 Screenshot"
url: https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/smartbrowz/generate-pdfnscreenshot/
description: "This page describes the method to generate PDF and Screenshot"
last_updated: 2026-09-08T11:07:33Z
service: SmartBrowz
type: general
related_links:
- name: "PDF \u0026 Screenshot - API"
url: /en/api/code-reference/smartbrowz/generate-pdfnscreenshoturl/#PDF%26ScreenshotwithHTML%2fURLasInput
---
# PDF & Screenshot
> **Note:** This SDK is currently in deprecation. Migrate to [JavaScript SDK](https://docs.catalyst.zoho.com/en/sdk/javascript/v1/smartbrowz/pdf-and-screenshot/pdf-from-htmlcode/) now.
Catalyst SmartBrowz offers you the [PDF & Screenshot](https://docs.catalyst.zoho.com/en/smartbrowz/help/pdfnscreenshot/introduction/) 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](https://docs.catalyst.zoho.com/en/smartbrowz/help/templates/create-templates/) as your input.
### Generate Visual Documents Using Template
```javascript
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
```javascript
const smartbrowz = app.smartbrowz();
let result = await smartbrowz.convertToPdf("HI",
{
"pdf_options": {
'display_header_footer': true,
'footer_template': '
Page
',
'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
```javascript
const smartbrowz = app.smartbrowz();
let result = await smartbrowz.convertToPdf("https://www.google.com",
{
"pdf_options": {
'display_header_footer': true,
'footer_template': 'Page
',
'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](https://docs.catalyst.zoho.com/en/smartbrowz/help/pdfnscreenshot/implementation/#generating-pdf--screenshots-through-playground), and you can also [copy the SDK](https://docs.catalyst.zoho.com/en/smartbrowz/help/pdfnscreenshot/implementation/#generating-pdf--screenshots-through-code) directly from the console.
> **Note:** 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 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.