API2PDF connects to a Nagent workspace with an API key. Once it is connected, agents can call 10 API2PDF actions, such as "Add Header Footer", "Check API Status" and "Delete PDF". Nothing is enabled on connect: each action is allowed one at a time, and an action with side effects runs or waits for a person according to the agent's level.
Every operation an agent can call against API2PDF, with input parameters and output schema.
API2PDF_ADD_HEADER_FOOTERConvert HTML to PDF with customizable headers and footers using Headless Chrome. Use for generating reports, invoices, or documents with consistent page numbering, titles, dates, or branding on every page.
Input parameters
Raw HTML content to convert into a PDF. Must include any page structure needed.
Advanced options for header and footer display in the PDF.
Desired filename for the generated PDF (e.g., 'report.pdf'). If omitted, the API assigns a random name.
If true, returns the PDF inline as base64; otherwise, returns a download URL.
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
API2PDF_CHECK_STATUSTool to check the health status of the API2PDF service. Use when you need to verify if the API is available and responding. This endpoint does not require authentication and returns a simple status indicator.
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
API2PDF_DELETE_PDFDelete a previously generated PDF from API2PDF storage by its response ID. By default, API2PDF automatically deletes PDFs after 24 hours. Use this tool when you need to immediately remove a PDF for security or cleanup purposes. The response_id parameter is the ResponseId returned from any PDF generation operation (e.g., merge, convert HTML to PDF, etc.).
Input parameters
The ResponseId returned from a previous API2PDF operation (e.g., merge, convert). This UUID identifies the PDF file to delete from API2PDF storage.
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
API2PDF_EXTRACT_PAGESTool to extract specific pages from a PDF document. Use when you need only certain pages from a larger PDF file. Provide a URL to the source PDF and optionally a page range (0-indexed, end exclusive). Returns a URL to the extracted PDF.
Input parameters
Zero-based index of the last page to extract (exclusive). Negative values count from end. Defaults to end of document. When both start and end are 0 (or omitted), all pages are extracted.
URL of the source PDF (must start with http:// or https://).
Zero-based index of the first page to extract (inclusive). Negative values count from end (-1 is last page). Defaults to 0 (first page).
If true, returns the PDF inline; otherwise returns a download URL. Default is true.
Custom storage settings for uploading the extracted PDF file.
Desired filename for the extracted PDF (e.g., 'pages.pdf'). Random name if omitted.
Key-value object specifying headers when fetching the source PDF.
When true, upload the extracted PDF via the provided storage settings.
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
API2PDF_LIBREOFFICE_PDF_TO_HTMLTool to convert a PDF document to HTML using LibreOffice. Use when you need HTML output of a PDF file (experimental; images may be excluded).
Input parameters
Direct URL to the source PDF file.
If true, returns HTML content inline in the JSON response; otherwise returns a URL.
Desired filename for the output HTML file (e.g., 'output.html').
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
API2PDF_LIBREOFFICE_THUMBNAILTool to generate a thumbnail image of a document using LibreOffice. Use when you need a quick visual preview of a PDF or Office file's first page.
Input parameters
Direct URL to a publicly accessible PDF or Office document (Word, Excel, PowerPoint) to generate a thumbnail from.
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
API2PDF_MERGE_PDFSMerge multiple PDF documents into a single PDF file. Provide a list of publicly accessible PDF URLs, and they will be combined in the order specified. The merged PDF is available via a download URL for 24 hours.
Input parameters
List of publicly accessible URLs pointing to PDF files to merge. The PDFs will be combined in the order they appear in this list.
If true, open the merged PDF in the browser; otherwise force download
Custom storage settings for uploading the merged PDF.
Desired filename for the merged PDF (e.g., 'output.pdf'). Random name if omitted
Optional headers to use when fetching each source PDF
When true, upload the merged PDF via the provided storage settings
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
API2PDF_OPTIMIZE_PDFTool to optimize a PDF document to reduce file size while maintaining quality. Use when you need to minimize storage or bandwidth for an existing PDF.
Input parameters
URL of the PDF file to optimize. Must start with http:// or https://
If true, open the optimized PDF in a browser window. Defaults to True.
Custom storage options: method, url, extraHTTPHeaders. Required if useCustomStorage is true.
Filename for the output PDF. Random name if omitted.
Headers to include when fetching the source PDF.
Whether to use custom storage options (see `storage`). Defaults to False.
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
API2PDF_REORDER_PAGESReorder pages of a PDF document by specifying a new page sequence. Provide a URL to the source PDF and a list of zero-based page indices in the desired order. For example, to reverse a 3-page PDF, use pages=\[2,1,0\]. The reordered PDF is available via a download URL for 24 hours.
Input parameters
URL of the source PDF to reorder (must start with http:// or https://).
List of zero-based page indices defining the new order. For example, \[2,0,1\] reorders a 3-page PDF to show page 3, then page 1, then page 2. Each index must be valid for the source PDF.
If true, returns the PDF inline; otherwise returns a download URL.
Custom storage settings for uploading the PDF file.
Desired filename for the reordered PDF (e.g., 'reordered.pdf'). Random name if omitted.
Key-value headers when fetching the source PDF.
When true, upload the final PDF via provided storage settings.
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
API2PDF_ZEBRA_GENERATE_BARCODETool to generate barcodes or QR codes using Zebra Crossing (ZXING). Use when you need a barcode or QR code image from text values.
Input parameters
The text or data value to encode in the barcode. For 1D barcodes, this is typically alphanumeric. For QR codes, can include URLs, text, or other data.
Width of the generated barcode image in pixels. If not specified, uses the API default.
Barcode format to generate. Supported 1D formats: CODABAR, CODE_39, CODE_93, CODE_128, EAN_8, EAN_13, ITF, RSS_14, RSS_EXPANDED, UPC_A, UPC_E, UPC_EAN_EXTENSION. Supported 2D formats: AZTEC, DATA_MATRIX, MAXICODE, PDF_417, QR_CODE. Most commonly used: QR_CODE (for 2D) or CODE_128 (for 1D).
Height of the generated barcode image in pixels. If not specified, uses the API default.
When true, displays the human-readable text value below the barcode image. API default is false.
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
Agents can call 10 API2PDF actions on Nagent, including "Add Header Footer", "Check API Status" and "Delete PDF". Add Header Footer: Convert HTML to PDF with customizable headers and footers using Headless Chrome. Each action is listed on this page with its input parameters and its output.
API2PDF connects with an API key, under your workspace's own connection. Nothing is enabled on connect: each action is allowed one at a time and can be scoped to the agents that need it.
Add Header Footer takes 1 required input: html. It also takes 3 optional inputs: options, fileName and inlinePdf. It returns data, error and successful.