--- title: "Generate PDF with URL as Source" url: https://docs.catalyst.zoho.com/en/sdk/javascript/v1/smartbrowz/pdf-and-screenshot/pdf-from-url-source/ description: "This page describes the method to perform operations using the components in SmartBrowz Services." last_updated: 2026-09-09T10:45:38Z service: SmartBrowz type: general related_links: - name: "Catalyst SmartBrowz" url: /en/smartbrowz/ - name: "PDF \u0026 Screenshot" url: /en/smartbrowz/help/pdfnscreenshot/introduction/ - name: "Templates" url: /en/smartbrowz/help/templates/introduction/ - name: "Java SDK Documentation" url: /en/sdk/java/v1/smartbrowz/generate-pdfnscreenshot/ - name: "Python SDK Documentation" url: /en/sdk/python/v1/smartbrowz/generate-pdfnscreenshot/ - name: "REST API Documentation" url: /en/api/code-reference/smartbrowz/generate-pdfnscreenshoturl/#PDF%26ScreenshotwithHTMLorURLasInput repository: name: "Repository" url: https://github.com/catalystbyzoho/zcatalyst-sdk-js --- # Generate PDF with URL as Source > **Notes:** * Ensure you have installed the [required package](https://docs.catalyst.zoho.com/en/sdk/javascript/v1/smartbrowz/overview/#prerequisites) 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. Pass the required URL to the `convertToPdf()` SDK method to generate a visual document of the corresponding webpage. The `smartbrowz` reference used in the code snippets below is the [component instance](https://docs.catalyst.zoho.com/en/sdk/javascript/v1/smartbrowz/create-smartbrowz-instance/) created to perform these operations. ```javascript const 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: "*****123" }, 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); ```