Extract Font Details from a PDF with PDF.co and Zapier

This tutorial shows how to extract text and formatting details from PDF files using PDF.co and Zapier. The resulting JSON can include font names, sizes, styles, colors, text coordinates, and dimensions.

Workflow

Google Drive → PDF.co PDF to Anything Converter → JSON output

Step 1: Create the Google Drive Trigger

Create a new Zap and select Google Drive as the trigger app.

Choose New File in Folder as the trigger event, then:

  1. Connect your Google Drive account.
  2. Select the drive and folder containing the PDF files.
  3. Test the trigger and select a sample PDF.

The selected file must provide a link that PDF.co can access.

Step 2: Add the PDF.co Action

  • Add an action and select PDF.co.

Choose PDF to Anything Converter, then connect your PDF.co account when prompted.

Configure the action:

  • Output Format: JSON (text objects and structure)
  • Source File URL: Map the PDF file or web content link from Google Drive.
  • Page Selection: Enter 0- to process every page.
  • File Name: Enter a name such as font-details.json.
  • OCR Language: Select the document language if the PDF is scanned.

The current fields available for this action are listed in the PDF.co documentation.

Step 3: Test the Conversion

Test the PDF.co action.

A successful conversion returns a temporary URL for the generated JSON file. Open the URL to inspect or download the output.

The JSON describes the document’s pages and text objects. A text object may contain properties similar to these:

{
  "text": {
    "fontName": "Arial",
    "fontSize": "24.0",
    "fontStyle": "Bold",
    "color": "#538DD3",
    "x": "36.00",
    "y": "34.44",
    "width": "242.81",
    "height": "24.00",
    "text": "Your Company Name"
  }
}

These properties indicate:

  • fontName: Font used for the text
  • fontSize: Text size
  • fontStyle: Styling such as bold or italic
  • color: Text color
  • x and y: Text position on the page
  • width and height: Text-object dimensions
  • text: Extracted text value

The exact structure can vary according to the document and conversion settings.

Step 4: Use the JSON Output

The returned JSON URL is temporary. If the data must be retained, add another Zapier action to save the file to Google Drive, Dropbox, or another storage service.

Map the URL returned by PDF.co into the destination action’s file field.

For endpoint details and advanced extraction settings, see the PDF-to-JSON API documentation.

Conclusion

The completed Zap monitors a Google Drive folder, converts each new PDF into structured JSON, and exposes the document’s text and font properties for further processing or storage.

Related Tutorials

See Related Tutorials