---
sourceDocument: Xanadu API Reference
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/xanadu/api-reference

 Release :

    - xanadu

ft:locale :

    - en-US

ft:publication_title :

    - Xanadu API Reference

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# PdfPage - Scoped, Global

# PdfPage - Scoped, Global {#ariaid-title1}

* Release version: Xanadu
* 
* Updated August 1, 2024
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 2 minutes to read

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](https://servicenow-prod.fluidtopics.net/oJ48cUW_0DIZl2sK2PI~9A#DocumentBothAPI "The Document API provides methods to initialize a PDF, add content, and close the PDF. After adding content, the document can be attached to a target record.") to generate a
PDF.

## PdfPage - PdfPage(String pageSize, String orientation) {#ariaid-title2}

Instantiates a new PdfPage object.
{#PdfPage-PdfPage_S_S__table_twm_hjk_34b__entry__3}

| Name | Type | Description |
|-|-|-|
| pageSize | String | PDF page size. Valid values: * A4 -- 595 x 842 points * EXECUTIVE -- 522 x 756 points * LETTER -- 612 x 792 points * LEDGER -- 792 x 1224 points {#PdfPage-PdfPage_S_S__ul_dml_q2p_k4b} |
| orientation | String | Optional. PDF page orientation. Valid values: * LANDSCAPE * PORTRAIT {#PdfPage-PdfPage_S_S__ul_igz_j3p_r4b} Default: PORTRAIT |
[Table 1. Parameters]

{#PdfPage-PdfPage_S_S__table_twm_hjk_34b}  
The following example shows how to create a PdfPage object.

    var pdfpage = new sn_pdfgeneratorutils.PdfPage("A4", "LANDSCAPE");

## PdfPage -- getBottom() {#ariaid-title3}

Gets the Y-coordinate of the lower edge of a PDF page.
{#PdfPage-getBottom__table_vv5_52h_44b__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Table 2. Parameters]

{#PdfPage-getBottom__table_vv5_52h_44b} {#PdfPage-getBottom__table_wv5_52h_44b__entry__2}

| Type | Description |
|-|-|
| Number | Decimal value of the Y-coordinate at the lower edge of the PDF page. |
[Table 3. Returns]

{#PdfPage-getBottom__table_wv5_52h_44b}  
The following example shows how to get the Y-coordinate of the lower edge of a PDF
page.

    var pdfpage = new sn_pdfgeneratorutils.PdfPage("A4", "LANDSCAPE");
     var bottom = pdfpage.getBottom();

## PdfPage -- getLeft() {#ariaid-title4}

Gets the X-coordinate of the left edge of a PDF page.
{#PdfPage-getLeft__table_vv5_52h_44b__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Table 4. Parameters]

{#PdfPage-getLeft__table_vv5_52h_44b} {#PdfPage-getLeft__table_wv5_52h_44b__entry__2}

| Type | Description |
|-|-|
| Number | Decimal value of the X-coordinate on the left edge of the page. |
[Table 5. Returns]

{#PdfPage-getLeft__table_wv5_52h_44b}  
The following example shows how to get the X-coordinate of the left edge of a PDF page.

    var pdfpage = new sn_pdfgeneratorutils.PdfPage("A4", "LANDSCAPE");
     var left = pdfpage.getLeft();

## PdfPage -- getPdfPageSize() {#ariaid-title5}

Gets the size of a PDF page
{#PdfPage-getPdfPageSize__table_vv5_52h_44b__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Table 6. Parameters]

{#PdfPage-getPdfPageSize__table_vv5_52h_44b} {#PdfPage-getPdfPageSize__table_wv5_52h_44b__entry__2}

| Type | Description |
|-|-|
| None |   |
[Table 7. Returns]

{#PdfPage-getPdfPageSize__table_wv5_52h_44b}  
The following example shows how to get the PDF page size.

    var pdfpage = new sn_pdfgeneratorutils.PdfPage("A4", "LANDSCAPE");
    var size = pdfpage.getPdfPageSize();

## PdfPage -- getRight() {#ariaid-title6}

Gets the X-coordinate of the right edge of a PDF page.
{#PdfPage-getRight__table_vv5_52h_44b__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Table 8. Parameters]

{#PdfPage-getRight__table_vv5_52h_44b} {#PdfPage-getRight__table_wv5_52h_44b__entry__2}

| Type | Description |
|-|-|
| Number | Decimal value of the X-coordinate on the right edge of the page. |
[Table 9. Returns]

{#PdfPage-getRight__table_wv5_52h_44b}  
The following example shows how to get the X-coordinate of the right edge of a PDF
page.

    var pdfpage = new sn_pdfgeneratorutils.PdfPage("A4", "LANDSCAPE");
     var right = pdfpage.getRight();

## PdfPage -- getTop() {#ariaid-title7}

Gets the Y-coordinate of the upper edge of a PDF page.
{#PdfPage-getTop__table_vv5_52h_44b__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Table 10. Parameters]

{#PdfPage-getTop__table_vv5_52h_44b} {#PdfPage-getTop__table_wv5_52h_44b__entry__2}

| Type | Description |
|-|-|
| Number | Decimal value of the Y-coordinate at the upper edge of the PDF page. |
[Table 11. Returns]

{#PdfPage-getTop__table_wv5_52h_44b}  
The following example shows how to get the Y-coordinate of the upper edge of a PDF
page.

    var pdfpage = new sn_pdfgeneratorutils.PdfPage("A4", "LANDSCAPE");
     var top  = pdfpage.getTop();

## PdfPage -- getWidth() {#ariaid-title8}

Gets the width of a PDF page.
{#PdfPage-getWidth__table_vv5_52h_44b__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Table 12. Parameters]

{#PdfPage-getWidth__table_vv5_52h_44b} {#PdfPage-getWidth__table_wv5_52h_44b__entry__2}

| Type | Description |
|-|-|
| Number | Size of the page width in points. |
[Table 13. Returns]

{#PdfPage-getWidth__table_wv5_52h_44b}  
The following example shows how to retrieve the width of a PDF page.

    var pdfpage = new sn_pdfgeneratorutils.PdfPage("A4", "LANDSCAPE");
    var width = PdfPage.getWidth();


