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:

    
copy
import 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.takeScreenshot(convertDetailsForPDF);

Take a screenshot from URL

    
copy
// initialize SmartBrowz ZCSmartBrowz smartBrowz = ZCSmartBrowz.getInstance(); ZCSmartBrowzConvertDetails convertDetailsForScreenshot = ZCSmartBrowzConvertDetails.getInstance(); convertDetailsForScreenshot.setUrl("YOUR_URL"); smartBrowz.convertToPdf(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.

Last Updated 2023-09-03 01:06:41 +0530 +0530