SVGToPDFConversionAPI - Scoped, Global
-
- UpdatedJan 30, 2025
- 5 minutes to read
- Yokohama
- API reference
The SVGToPDFConversionAPI provides methods that enable the adding of an SVG to a PDF and converting an SVG to PDF.
This API is part of the ServiceNow PDF
Generation Utilities plugin (com.snc.apppdfgenerator) and is provided within the
sn_pdfgeneratorutils
namespace. The plugin is activated by default.
See also PDFGenerationAPI.
SVGToPDFConversionAPI - SVGToPDFConversionAPI()
Instantiates a new SVGToPDFConversionAPI object.
Name | Type | Description |
---|---|---|
None |
Example
The following examples shows how to create a SVGToPDFConversionAPI object.
SVGToPDFConversionAPI - addSVGToPDF(String svg, String inputPdfSysId, String targetTable, String targetSysId, String nameForPdf, Number pageNo, Number x, Number y, Number svgImgWidth, Number svgImgHeight)
Adds an SVG image to a PDF on a specified page with image size and location coordinates.
Example
The following example shows how get SVG from the description field of an incident record and add it to page 5 of a PDF attachment. The new PDF with SVG is located in the Attachments [sys_attachment] table.
Output:
SVGToPDFConversionAPI - convertSVGToPDF(String svg, String pdfName, String targetTable, String targetTableSysId)
Converts an SVG provided as string to PDF.
Example
The following example shows how get SVG from the description field of an incident record, to convert the SVG to PDF and attach it to a record.
Example
Output:
SVGToPDFConversionAPI - convertSVGToPDFWithSize(String svg, String nameForPDF, String targetTable, String targetTableSysId, Number svgImgWidth, Number svgImgHeight)
Converts an SVG provided as string to PDF with image width and height values.
Example
The following example shows how get SVG from the description field of an incident record, to convert the SVG to PDF, and attach it to a record.
Output:
On this page
- SVGToPDFConversionAPI - SVGToPDFConversionAPI()
- SVGToPDFConversionAPI - addSVGToPDF(String svg, String inputPdfSysId, String targetTable,
String targetSysId, String nameForPdf, Number pageNo, Number x, Number y, Number svgImgWidth,
Number svgImgHeight)
- SVGToPDFConversionAPI - convertSVGToPDF(String svg, String pdfName, String targetTable,
String targetTableSysId)
- SVGToPDFConversionAPI - convertSVGToPDFWithSize(String svg, String nameForPDF, String
targetTable, String targetTableSysId, Number svgImgWidth, Number svgImgHeight)