PDF.co

App · File Conversion · 9 actions

Automate PDF conversions, barcode reading, document editing, and data extraction with PDF.co.

Actions

ActionWhat it does
Add text watermarkStamp a line of text across every page of a PDF at a chosen position.
Convert HTML to PDFTurn HTML content into a PDF file, with an optional file name.
Convert PDF to CSVTurn the tables in a PDF into a CSV spreadsheet file.
Convert PDF to textExtract the plain text from a PDF using PDF.co.
List document parser templatesList the Document Parser templates on the account, both your own and the ones PDF.co provides, with the ID needed to parse a document.
Merge PDFsCombine multiple PDF files into a single document.
Parse documentPull the fields and tables out of a PDF or image using one of your PDF.co Document Parser templates: for example the invoice number, due date, and line items on an invoice.
Read barcodesScan a PDF or image and read any barcodes it contains.
Split PDF by page rangesSplit a PDF into multiple files using page ranges.

Add text watermark

Stamp a line of text across every page of a PDF at a chosen position.

Inputs

Source URLsource_urltextRequired
Public URL of the PDF to watermark.
TexttexttextRequired
Watermark text to place in the PDF.
Horizontal position (X)xnumber
Horizontal position for the watermark text, in points.
Vertical position (Y)ynumber
Vertical position for the watermark text, in points.

Outputs

urltext
Download link for the watermarked PDF file.
Example output
{
  "url": "mock_value"
}

Convert HTML to PDF

Turn HTML content into a PDF file, with an optional file name.

Inputs

HTMLhtmltextRequired
The HTML content to turn into a PDF.
File namenametext
Optional file name for the generated PDF.

Outputs

nametext
File name of the generated PDF.
urltext
Download link for the generated PDF file.
Example output
{
  "name": "mock_value",
  "url": "mock_value"
}

Convert PDF to CSV

Turn the tables in a PDF into a CSV spreadsheet file.

Inputs

Source URLsource_urltextRequired
Public URL of the PDF to convert.
Pagespagestext
Optional pages to convert. The first page is 0, so 0-2 means the first three pages. Leave blank to convert every page.

Outputs

csv_urltext
Download link for the generated CSV file.
Example output
{
  "csv_url": "mock_value"
}

Convert PDF to text

Extract the plain text from a PDF using PDF.co.

Inputs

Source URLsource_urltextRequired
Public URL of the PDF to convert.
Pagespagestext
Optional pages to convert. The first page is 0, so 0-2 means the first three pages. Leave blank to convert every page.

Outputs

texttext
The plain text extracted from the PDF.
Example output
{
  "text": "mock_value"
}

List document parser templates

List the Document Parser templates on the account, both your own and the ones PDF.co provides, with the ID needed to parse a document.

Inputs

None.

Outputs

remaining_creditsnumber
PDF.co credits left on the account.
template_countnumber
How many templates were returned.
templateslist
The templates available on the account.
Example output
{
  "remaining_credits": 94229,
  "template_count": 2,
  "templates": [
    {
      "description": "Parses invoices and extracts invoice number, company name, due date, amount, tax",
      "id": "1",
      "title": "Invoice Parser",
      "type": "system"
    },
    {
      "description": "Untitled",
      "id": "40",
      "title": "Untitled",
      "type": "user"
    }
  ]
}

Merge PDFs

Combine multiple PDF files into a single document.

Inputs

PDF URLsfile_urlslistRequired
The PDFs to merge, in order (at least two). Give one URL per entry, or paste them all separated by commas.
Output nameoutput_nametext
Optional name for the merged file.

Outputs

file_countnumber
Number of PDF files that were merged.
urltext
Download link for the merged PDF file.
Example output
{
  "file_count": 1,
  "url": "mock_value"
}

Parse document

Pull the fields and tables out of a PDF or image using one of your PDF.co Document Parser templates: for example the invoice number, due date, and line items on an invoice.

Inputs

Source URLsource_urltextRequired
Public URL of the PDF or image to parse.
Templatetemplate_idtextRequired
The Document Parser template that says which fields and tables to pull out. PDF.co provides built-in templates (such as Invoice Parser), and you can create your own at https://app.pdf.co/document-parser/templates.
Pagespagestext
Optional pages to parse. The first page is 0, so 0-2 means the first three pages. Leave blank to parse every page.
Passwordpasswordtext
Optional password, if the PDF is protected.

Outputs

fieldsobject
Each field the template found, by name.
objectslist
The raw result from PDF.co, including each value's position on the page.
page_countnumber
Number of pages in the document.
remaining_creditsnumber
PDF.co credits left on the account.
tableslist
Every table the template found.
template_nametext
Name of the template used to read the document.
template_versiontext
Version of the template used to read the document.
Example output
{
  "fields": {
    "companyName": "Amazon Web Services, Inc",
    "dateDue": "2018-04-03T00:00:00",
    "invoiceId": "123456789",
    "total": 6.58
  },
  "objects": [
    {
      "name": "invoiceId",
      "objectType": "field",
      "pageIndex": 0,
      "rectangle": [
        0,
        0,
        0,
        0
      ],
      "value": "123456789"
    }
  ],
  "page_count": 1,
  "remaining_credits": 60803,
  "tables": [
    {
      "name": "table",
      "row_count": 1,
      "rows": [
        {
          "amount": "5.57",
          "description": "Data Transfer"
        }
      ]
    }
  ],
  "template_name": "Generic Invoice [en]",
  "template_version": "4"
}

Read barcodes

Scan a PDF or image and read any barcodes it contains.

Inputs

Source URLsource_urltextRequired
Public URL of the file containing barcodes.
Barcode typesbarcode_typeslistRequired
The barcode types to look for -- PDF.co needs to know which ones to decode. Give one type per entry, or paste them separated by commas. Common types are QRCode, Code128, Code39, EAN13, UPCA, PDF417, and DataMatrix; see https://docs.pdf.co/api/barcode/read-barcodes for the full list.

Outputs

barcodeslist
The barcodes found, each with its type, value, and page.
Example output
{
  "barcodes": [
    {}
  ]
}

Split PDF by page ranges

Split a PDF into multiple files using page ranges.

Inputs

Source URLsource_urltextRequired
Public URL of the PDF to split.
Page rangespage_rangestextRequired
Where to split the PDF, given as page ranges. The first page is 0, so 0-1,2,3- splits after page 2, after page 3, and keeps the rest.

Outputs

urlslist
Download links for each split PDF file.
Example output
{
  "urls": [
    "mock_value"
  ]
}

On this page