PDF.co API icon

PDF.co API

Generate PDF, extract data from PDF, split PDF, merge PDF, convert PDF. Fill PDF forms, add text and images to pdf and much more with pdf.co!

Convert To PDF

AI-generated

Overview

This node converts various file types to PDF format using the PDF.co service. It supports converting CSV, document files (RTF, DOC, DOCX, TXT), email files (MSG, EML), image files (JPG, PNG, TIFF), and Excel files (XLS, XLSX) to PDF. Users provide the source file URL and select the conversion type. Advanced options allow customization such as setting output file name, worksheet index for Excel files, embedding email attachments, setting PDF margins, orientation, paper size, and more. This node is useful for automating document conversions in workflows, such as generating PDFs from reports, emails, images, or spreadsheets for archiving, sharing, or further processing.

Use Case Examples

  1. Convert a DOCX document from a public URL to PDF for easy sharing.
  2. Convert an Excel XLSX file to PDF, specifying the worksheet index to convert only a specific sheet.
  3. Convert an email file (EML) to PDF, embedding attachments and customizing paper size and orientation.

Properties

Name Meaning
Authentication Select the authentication method to use for the PDF.co API (API Key or OAuth2).
Convert Type Select the type of file conversion to PDF (CSV, Document, Email, Image, XLS, XLSX).
Source File URL of the File to Convert The direct URL of the file to convert. Must be publicly accessible.
Worksheet Index The index of the worksheet to convert (for XLS and XLSX files).
Advanced Options (Common) Additional options for document, XLS, XLSX, and image conversions, including custom output file name, callback URL, output link expiration, HTTP authentication for source URL, and custom PDF processing profiles.
Advanced Options (CSV) Additional options specific to CSV to PDF conversion, including auto sizing, custom file name, callback URL, output link expiration, HTTP authentication, and custom profiles.
Advanced Options (Email) Additional options specific to email to PDF conversion, including embedding attachments, converting attachments to PDF, margins, orientation, paper size, custom paper size, custom file name, callback URL, output link expiration, and custom profiles.

Output

JSON

  • url - The URL of the generated PDF file.
  • base64 - Base64 encoded string of the generated PDF file (if requested).
  • fileName - The name of the output PDF file.

Dependencies

  • PDF.co API key or OAuth2 credentials

Troubleshooting

  • Ensure the source file URL is publicly accessible and correct to avoid file download errors.
  • Check authentication credentials (API key or OAuth2) if the API call fails due to authorization errors.
  • Verify that the selected convert type matches the source file format to prevent conversion errors.
  • If using HTTP authentication for the source URL, ensure the username and password are correct.
  • Review the custom profiles JSON syntax carefully to avoid processing errors.

Links

Discussion