PDF & Screenshot
PDF & Screenshot is a component of SmartBrowz that lets you generate visual documents of websites and web applications. It is a powerful tool that can be used to convert webpages to PDF, to use during UI debugging, and to understand visual components from end-users’ perspective, while implementing permitted crawling operations, just to name a few.
You can introduce this functionality in your Catalyst application using the API below.
Generate PDF Using HTML/URL
PDF Description
You can use this API to generate PDF documents of webpages by using HTML code or URL as your input.
PDF Request Details
Request URL
{api-domain}/browser360/v1/project/{project_id}/convert
Scope
ZohoCatalyst.pdfshot.EXECUTE
Request Headers
Authorization: Zoho-oauthtoken {oauth_token}
Content-Type: application/json
Request JSON Properties
Default: false.
HTML template for the print header. Should be valid HTML with the following classes to inject values into them:
The default value can be changed by using the
page.set_default_timeout() or page.set_default_navigation_timeout() methods.
PDF Response Details
The response will return the PDF document generated.
Generate Screenshot Using HTML/URL
Screenshot Description
You can use this API to generate screenshots of webpages using HTML code or URL as your input.
Screenshot Request Details
Request URL
{api-domain}/browser360/v1/project/{project_id}/convert
Scope
ZohoCatalyst.pdfshot.EXECUTE
Request JSON Properties
Screenshot Response Details
The response will return a screenshot that was generated.
curl -X POST \ ‘https://api.catalyst.zoho.com/browser360/v1/project/10470000000272001/convert'
-H “Authorization: Zoho-oauthtoken 1000.910*************************16.2f*************************57”
-H ‘Content-Type: application/json’
–d ‘{
“url”: “https://www.example.com”,
“output_options”: {
“output_type”: “pdf”
},
“pdf_options” : {
“scale” : 1,
“display_header_footer” : true,
“header_template” : “<style> #header, #footer { margin: 0 !important; padding: 0 !important; font-size: 9px; -webkit-print-color-adjust: exact;}</style><div style=\width:100%><span class=\date></span><span class=\title\ style=\float:right></span</div>”,
“footer_template” : “<style> #header, #footer { margin: 0 !important; padding: 0 !important; font-size: 9px; -webkit-print-color-adjust: exact;}</style><div style=\width:100%><span class=\url></span><div style=\float:right><span class=\pageNumber></span> / <span class=\totalPages></span></div></div>”,
“print_background” : false,
“landscape” : false,
“page_ranges” : “1”,
“format” : “A4”,
“width” : “100”,
“height” : “100”,
“margin” :
{
“top” : “1cm”,
“bottom” : “1cm”,
“left” : “1cm”,
“right”: “1cm”
},
“omit_background” : false
},
“page_options”:{
“css” : {
“content” : “body{background: lightgrey}”
},
“viewport” : {
“width”: 1440,
“height”: 900
},
“javascript_enabled” : true
},
“navigation_options”:{
“timeout” : 5000,
“wait_until” : “networkidle0”
}
}’
curl -X POST \ ‘https://api.catalyst.zoho.com/browser360/v1/project/10470000000272001/convert'
-H “Authorization: Zoho-oauthtoken 1000.910*************************16.2f*************************57”
-H ‘Content-Type: application/json’
–d’{
“url”: “https://www.example.com”,
“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
},
“javascript_enabled”: true
},
“navigation_options”: {
“timeout”: 5000,
“wait_until”: “networkidle0”
}
}’
Yes
No
Send your feedback to us