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.
Ensure the following packages are imported:
copyimport com.zc.component.smartbrowz.ZCSmartBrowz; import com.zc.component.smartbrowz.ZCSmartBrowzConvertDetails;
Generate Visual Document From a Predefined Template
copy// initialize SmartBrowz ZCSmartBrowz smartBrowz = ZCSmartBrowz.getInstance(); ZCSmartBrowzConvertDetails convertDetailsForTemplateConversion = ZCSmartBrowzConvertDetails.getInstance(); convertDetailsForTemplateConversion.setTemplateId(YOUR_TEMPLATE_ID); smartBrowz.generateFromTemplate(convertDetailsForTemplateConversion);
Convert to PDF from HTML
copy// initialize SmartBrowz ZCSmartBrowz smartBrowz = ZCSmartBrowz.getInstance(); ZCSmartBrowzConvertDetails convertDetailsForPDF = ZCSmartBrowzConvertDetails.getInstance(); convertDetailsForPDF.setHtml("YOUR_HTML_CODE"); smartBrowz.convertToPdf(convertDetailsForPDF);
Take a screenshot from URL
copy// initialize SmartBrowz ZCSmartBrowz smartBrowz = ZCSmartBrowz.getInstance(); ZCSmartBrowzConvertDetails convertDetailsForScreenshot = ZCSmartBrowzConvertDetails.getInstance(); convertDetailsForScreenshot.setUrl("YOUR_URL"); smartBrowz.takeScreenshot(convertDetailsForScreenshot);
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.
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.
Last Updated 2024-09-30 11:58:13 +0530 +0530
Yes
No
Send your feedback to us
Skip
Submit