PdfPage - Scoped, Global
-
- UpdatedJan 30, 2025
- 2 minutes to read
- Yokohama
- API reference
Creates a PdfPage object representing a PDF page and its attributes; such as size, width, and color.
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.
This API is a component used with the Document API to generate a PDF.
PdfPage - PdfPage(String pageSize, String orientation)
Instantiates a new PdfPage object.
Name | Type | Description |
---|---|---|
pageSize | String | PDF page size. Valid values:
|
orientation | String | Optional. PDF page orientation. Valid values:
Default: PORTRAIT |
Example
The following example shows how to create a PdfPage object.
PdfPage – getBottom()
Gets the Y-coordinate of the lower edge of a PDF page.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
Number | Decimal value of the Y-coordinate at the lower edge of the PDF page. |
Example
The following example shows how to get the Y-coordinate of the lower edge of a PDF page.
PdfPage – getLeft()
Gets the X-coordinate of the left edge of a PDF page.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
Number | Decimal value of the X-coordinate on the left edge of the page. |
Example
The following example shows how to get the X-coordinate of the left edge of a PDF page.
PdfPage – getPdfPageSize()
Gets the size of a PDF page
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
None |
Example
The following example shows how to get the PDF page size.
PdfPage – getRight()
Gets the X-coordinate of the right edge of a PDF page.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
Number | Decimal value of the X-coordinate on the right edge of the page. |
Example
The following example shows how to get the X-coordinate of the right edge of a PDF page.
PdfPage – getTop()
Gets the Y-coordinate of the upper edge of a PDF page.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
Number | Decimal value of the Y-coordinate at the upper edge of the PDF page. |
Example
The following example shows how to get the Y-coordinate of the upper edge of a PDF page.
PdfPage – getWidth()
Gets the width of a PDF page.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
Number | Size of the page width in points. |
Example
The following example shows how to retrieve the width of a PDF page.