---
sourceDocument: Yokohama Data and Automation
sourceDocumentLink: https://www.servicenow.com/docs/r/yokohama/integrate-applications

 Release :

    - yokohama

ft:locale :

    - en-US

ft:publication_title :

    - Yokohama Data and Automation

ft:clusterId :

    - crint

bundleId :

    - crint

workflow :

    - Creator


---

# PDF connector methods

# PDF connector methods {#ariaid-title1}

* Release version: Yokohama
* 
* Updated January 30, 2025
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 8 minutes to read

Summarize  
![AI sparkle icon](https://servicenow.com/docs/portal-asset/ai-sparkle-icon) Summarized using AI  
This content was generated using new OpenAI-powered functionality. Results are provided on an as is basis and are not guaranteed to be accurate or complete.  

## Summary of PDF connector methods

The PDF connector in RPA Desktop Design Studio enables ServiceNow customers to automate and accelerate PDF document processing.
It provides a comprehensive set of methods to load, convert, extract, merge, split, and manage PDF files programmatically.
This functionality supports various output formats and data extraction needs, which is essential for document automation workflows.
Show full answer Show less  

## Prerequisites

* Always use the **Load** method first to open a PDF file by specifying its full path and optional password.
* Use the **Close** method after completing operations to release resources.

## Key Methods and Their Practical Uses

* **ConvertToExcel:** Converts a PDF to an Excel file, with an option to convert only tables.
* **ConvertToHTML:** Converts specified or all PDF pages to HTML content returned as a string.
* **ConvertToImage(s):** Converts one or multiple PDF pages to image files, supporting DPI and quality customization.
* **ConvertToWord:** Converts a PDF document to a Microsoft Word file.
* **ConvertToXml:** Converts a single page of a PDF to XML format, optionally extracting only tables.
* **ExtractImages:** Extracts images from a range of PDF pages and saves them to a specified folder.
* **GetAllTables:** Extracts all tables from a PDF as a list of DataTables for structured data retrieval.
* **GetPageAsImage:** Retrieves a specific PDF page as an in-memory image object.
* **GetPageCount:** Retrieves the total number of pages in the loaded PDF.
* **GetTable:** Extracts a specific table by page number or by matching text, returning a DataTable.
* **GetText:** Extracts text from a specified page range, returning it as a string.
* **Merge:** Combines multiple PDFs into one file, with an optional overwrite flag.
* **Split:** Splits a PDF into individual pages saved as separate files in a specified folder.

## Why This Matters

This set of PDF connector methods enables ServiceNow customers to integrate PDF document handling directly into their automation workflows. By supporting multiple output formats and detailed extraction capabilities, customers can streamline data capture, reporting, and document management processes, reducing manual effort and improving accuracy.

## What to Expect

* Efficient loading and closing of PDF files to manage resources effectively.
* Flexible conversion options to Excel, Word, HTML, XML, and images with configurable parameters.
* Powerful data extraction features, including tables, text, images, and page counts.
* Robust file management through merge and split capabilities.
* Clear parameter usage for each method to tailor operations to specific automation needs.  
Accelerate PDF processing for your document automation by using the various methods of PDF connector in RPA Desktop Design Studio.

## Prerequisites for using the PDF connector {#pdf-connector-methods__section_hcl_ptp_rfc}

Use the Load method in PDF connector before using the other methods. Call this method with the full path to the PDF file (FilePath) and optionally provide a password (Password) if the PDF is protected.

## Close {#pdf-connector-methods__section_gqk_nph_3xb}

Closes the resources associated with the PDF document. Use this method to release any references and resources after using the Load method.

Call this method when you no longer need to use the PDF document or after completing operations with it.

## ConvertToExcel {#pdf-connector-methods__section_zm1_1qd_3xb}

Converts a PDF document to a Microsoft Excel document. Optionally, only tables can be converted if specified.

Call this method with the file path where the converted Excel document must be saved, and optionally set ConvertTablesOnly to True if only tables must be converted.  
{#pdf-connector-methods__table_lvt_3hb_3cc__entry__3}

| Parameter | Description | Data type |
|-|-|-|
| ExcelFilepath | The file path where the converted Excel document (.xlsx) is saved. Ensure the file path includes the file name and extension. | String |
| ConvertTablesOnly | If set to True, only tables from the PDF document are converted to Excel. Default is True. | Boolean |
[Table 1. Parameters of the ConvertToExcel method]

{#pdf-connector-methods__table_lvt_3hb_3cc}

## ConvertToHTML {#pdf-connector-methods__section_cqv_3qd_3xb}

Converts a specified page of a PDF to HTML format. If the page number is less than or equal to 0, all pages of the PDF are converted to HTML.

Call this method with the page number of the PDF that you want to convert to HTML. If you pass a page number less than or equal to 0, the entire PDF will be converted to HTML. The method returns the HTML content as a string.  
{#pdf-connector-methods__table_sbv_j5d_3xb__entry__3}

| Parameter | Description | Data type |
|-|-|-|
| PageNumber (Data In) | The page number of the PDF to be converted to HTML. If this parameter is less than or equal to 0, all pages of the PDF are converted to HTML. Page numbers typically start from 1. | Int32 |
| Return (Data Out) | This method returns the HTML content as a string, representing the content of the PDF file. | String |
[Table 2. Parameters of the ConvertToHTML method]

{#pdf-connector-methods__table_sbv_j5d_3xb}

## ConvertToImage {#pdf-connector-methods__section_nsk_4qd_3xb}

Converts a specified page of a PDF document to an image. Optionally, specify the image path where the image is saved, DPI (dots per inch), and image quality.

Call this method with the page number of the PDF to convert, the file path where the image must be saved, and optionally adjust the DPI and image quality parameters.  
{#pdf-connector-methods__table_urv_bvd_3xb__entry__3}

| Parameter | Description | Data type |
|-|-|-|
| PageNumber | The page number of the PDF to be converted to an image. Page numbers typically start from 1. | Int32 |
| ImagePath | The file path where the converted image is saved. Ensure the file path includes the file name and extension | String |
| Dpi | The DPI (dots per inch) resolution for the generated image. Default is 200 DPI. | Int32 |
| Quality | The quality level of the generated image, ranging from 0 (lowest) to 100 (highest). Default is 95. | Int32 |
[Table 3. Parameters of the ConvertToImage method]

{#pdf-connector-methods__table_urv_bvd_3xb}

## ConvertToImages {#pdf-connector-methods__section_sjm_rqd_3xb}

Converts a PDF document to images. Optionally, specify the folder path where the images are saved, DPI (dots per inch), image quality, and an optional list to store the generated file names.

Call this method with the folder path where the images must be saved. Optionally, adjust the DPI and image quality parameters. If you provide a list as the FileNames parameter, it is populated with the names
of the generated image files.  
{#pdf-connector-methods__table_jnw_jn5_krb__entry__3}

| Parameter | Description | Data type |
|-|-|-|
| Folderpath | The folder path where the converted images will be saved. Ensure the folder exists and has appropriate write permissions. For example, <kbd class="ph userinput">/Users/Username/Documents/MyFolder</kbd> | String |
| Dpi | The DPI (dots per inch) resolution for the generated images. Default is 200 DPI. | Int32 |
| Quality | The quality level of the generated images, ranging from 0 (lowest) to 100 (highest). Default is 95. | Int32 |
[Table 4. Parameters of the ConvertToImages method]

{#pdf-connector-methods__table_jnw_jn5_krb}

## ConvertToWord {#pdf-connector-methods__section_vsw_tpd_3xb}

Converts a PDF to a Microsoft Word document.

Call this method with the file path where the converted Word document must be saved. The method creates a Word document from the PDF content at the specified path.
{#pdf-connector-methods__table_mcn_qgb_3cc__entry__3}

| Parameter | Description | Data type |
|-|-|-|
| WordFilepath | The file path where the converted Word document (.doc) is saved. Ensure the file path includes the file name and extension. | String |
[Table 5. Parameter of the ConvertToWord method]

{#pdf-connector-methods__table_mcn_qgb_3cc}

## ConvertToXml {#pdf-connector-methods__section_mvr_zqd_3xb}

Converts a specified page of a PDF document to Microsoft XML format. Optionally, only tables can be converted if specified.

Call this method with the page number of the PDF to convert, the file path where the XML output must be saved, and optionally set ConvertTablesOnly to True if only tables must be
converted.  
{#pdf-connector-methods__table_wnt_w5g_3xb__entry__3}

| Parameter | Description | Data type |
|-|-|-|
| PageNumber | The page number of the PDF to be converted to XML format. Page numbers typically start from 1. | Int32 |
| XmlFilePath | The file path where the converted XML document will be saved. Ensure the file path includes the file name and extension | String |
| ConvertTablesOnly | If set to True, only tables from the specified page will be converted to XML. Default is True. | Boolean |
[Table 6. Parameters of the ConvertToXml method]

{#pdf-connector-methods__table_wnt_w5g_3xb}

## ExtractImages {#pdf-connector-methods__section_z32_2rd_3xb}

Extracts images from specified pages of a PDF document. Optionally, specify the folder path where the images are saved and an output list to store the generated file names.

Call this method with the folder path where the images must be saved, the starting and ending page numbers from which to extract images, and an empty list to store the file names of the extracted images.  
{#pdf-connector-methods__table_wqr_jwg_3xb__entry__3}

| Parameter | Description | Data type |
|-|-|-|
| Folderpath | The folder path where the extracted images are saved. Ensure the folder exists and has appropriate write permissions. | String |
| FromPage | The starting page number from which to extract images. Page numbers typically start from 1. | Int32 |
| ToPage | The ending page number up to which images must be extracted. This number must be greater than or equal to the FromPage number. | Int32 |
| FileNames | An output parameter that stores the file names of the extracted images. | List\`1 |
[Table 7. Parameters for the ExtractImages method]

{#pdf-connector-methods__table_wqr_jwg_3xb}

## GetAllTables {#pdf-connector-methods__section_h4r_grd_3xb}

Extracts all tables from a PDF document and returns them as a list of DataTables.

Use the Return parameter to retrieve the extracted table data as a list.

Call this method without any parameters to retrieve all tables from the PDF document. The method returns a list of DataTables, where each DataTable represents a table extracted from the PDF.  
{#pdf-connector-methods__table_ox4_xvb_3cc__entry__3}

| Parameter | Description | Data type |
|-|-|-|
| Return | This method returns list of DataTable that represents a tables extracted from the PDF file. | List\`1 |
[Table 8. Parameter of the GetAllTables method]

{#pdf-connector-methods__table_ox4_xvb_3cc}

## GetPageAsImage {#pdf-connector-methods__section_o45_jrd_3xb}

Extracts data from a PDF document page and store it as an in-memory image.

Returns a specified page of a PDF document as an in-memory image.

Call this method with the page number of the PDF to retrieve the page as an image. The method returns the page as a System.Drawing.Image object.  
{#pdf-connector-methods__table_plf_qxg_3xb__entry__3}

| Parameter | Description | Data type |
|-|-|-|
| PageNumber | The page number of the PDF to be converted to an image. Page numbers typically start from 1. | Int32 |
| Return | This method returns an image that represents a specified page of the PDF file. | Drawing.Image |
[Table 9. Parameters of the GetPageAsImage method]

{#pdf-connector-methods__table_plf_qxg_3xb}

## GetPageCount {#pdf-connector-methods__section_uhh_mrd_3xb}

Retrieves the total number of pages in a PDF document. You must use the Return parameter to retrieve the total page count in the PDF as an integer.  
{#pdf-connector-methods__table_fl5_vwb_3cc__entry__3}

| Parameter | Description | Data type |
|-|-|-|
| Return | This method returns an integer representing count of pages of the PDF file. | Int32 |
[Table 10. Parameter of the GetPageCount method]

{#pdf-connector-methods__table_fl5_vwb_3cc}

## GetTable {#pdf-connector-methods__section_hy5_srd_3xb}

Extracts a table from a PDF and returns it as a DataTable. The extraction method is specified by the ExtractBy parameter.

Call this method with the extraction type and the corresponding value. The method returns the extracted table as a DataTable.  
{#pdf-connector-methods__table_z3v_4yg_3xb__entry__3}

| Parameter | Description | Data type |
|-|-|-|
| ExtractBy | The method of extraction to use. This parameter must be ExtractType, which includes the following options: Index (0) - extract by page number, and ContainsText (1) - extract by matching text. | ExtractType |
| Value | The value corresponding to the extraction type. For example, if ExtractBy is Index, this would be the page number as a string; if ExtractBy is ContainsText, this would be the text to match. | String |
| Return | This method returns a DataTable that represents a table extracted from the PDF file. | Table |
[Table 11. Parameters of the GetTable method]

{#pdf-connector-methods__table_z3v_4yg_3xb}

## GetText {#pdf-connector-methods__section_vds_qsd_3xb}

Retrieves text from the given range of PDF pages.

Call this method with the starting and ending page numbers to retrieve text from those pages. The method returns the extracted text as a string.  
{#pdf-connector-methods__table_izn_yyg_3xb__entry__3}

| Parameter | Description | Data type |
|-|-|-|
| FromPage | The starting page number of the range from which to extract text. Page numbers typically start from 1. | Int32 |
| ToPage | The page number to which you retrieve text from the start page. Note: Ensure that the ToPage value is higher than the FromPage value. | Int32 |
| Return | This method returns a string representing the text content of the PDF file. | String |
[Table 12. Parameters of the GetText method]

{#pdf-connector-methods__table_izn_yyg_3xb}

## Load {#pdf-connector-methods__section_ljq_nlh_3xb}

Loads a PDF file for interaction, enabling further operations such as extracting content.

Call this method with the full path to the PDF file (FilePath) and optionally provide a password (Password) if the PDF is protected.  
{#pdf-connector-methods__table_qhm_k43_3xb__entry__3}

| Parameter | Description | Data type |
|-|-|-|
| FilePath | The full path to the PDF file to be loaded. This must include the file name and extension. | String |
| Password | The password for the PDF file if it is protected. If the PDF is not password-protected, this parameter can be an empty string. | String |
[Table 13. Parameters of Load method]

{#pdf-connector-methods__table_qhm_k43_3xb}

## Merge {#pdf-connector-methods__section_k5t_vmh_3xb}

Merges a list of PDF files into a single PDF file.

Call this method with a list of file paths of the PDFs to be merged, the output file path, and an optional overwrite flag.  
{#pdf-connector-methods__table_bny_zmh_3xb__entry__3}

| Parameter | Description | Data type |
|-|-|-|
| FileList | A list of file paths for the PDF files to be merged. Each path must be a valid path to a PDF file. | ArrayList |
| OutputFilePath | The file path where the merged PDF is saved. This must include the file name and extension. | String |
| Overwrite | If set to True, the method overwrites the existing file at the output path if it exists. If set to False, the method does not overwrite the existing file. Default is False. | Boolean |
[Table 14. Parameters of Merge method]

{#pdf-connector-methods__table_bny_zmh_3xb}  
Note:  
If the PDF files are password protected or in an incorrect format in the FileList parameter, the automation displays an error.

## Split {#pdf-connector-methods__section_nfc_x4h_3xb}

Splits a single PDF into multiple files, where each page in the PDF is saved as a separate file.

Call this method with the output folder path where the split PDF pages must be saved.  
{#pdf-connector-methods__table_ayk_l52_3cc__entry__3}

| Parameter | Description | Data type |
|-|-|-|
| OutputFolderPath | The path to the folder where the split PDF pages are saved. Ensure the folder exists or has appropriate permissions for writing files. | String |
[Table 15. Parameter of Split method]

{#pdf-connector-methods__table_ayk_l52_3cc}

