How to Extract Text, Font Name, Font Size, Font Style, Text Color and Text Position from PDF with PDF.co using Zapier?

In this tutorial, we will show you how you can extract font from PDF including font style, font size, text color, and text position from a PDF file. We will use this sample Invoice PDF as our source file.

Screenshot of Source PDF
Screenshot of Source PDF

Step 1: Open PDF.co and Select PDF to Anything Converter

Kindly choose PDF.co as the App and PDF to Anything Converter as the Action Event. The PDF to Anything Converter converts PDF to JPG, PNG, CSV, XML, JSON, and other formats.

PDF to Anything Converter Zapier action screenshot

Step 2: Configure the PDF to Anything Converter with the Data

  • In the Output Format field, select the JSON(text objects and forms)
  • In the PDF URL field, enter your PDF source file. In our case, we entered the sample Invoice PDF URL.
  • In the Name field, enter your desired output file name.
  • In the Inline Output field, choose False. Setting the Inline to False will return a URL where we can download the JSON file. Setting it to True will return the JSON inside the response instead of a downloadable file.
Zapier Output Format Field screenshot
Zapier Output Format Field screenshot

Step 3: Test & Review

Now it’s time to Test & Review our data and send PDF to Anything Converter to PDF.co.

Zapier Test action screenshot

Step 4: Download the Resulting JSON File

Our test was a success! Kindly copy the URL link and paste it on your browser’s address bar to download the resulting JSON file.

Successful Test action screenshot

Hurray! We have successfully converted the sample Invoice PDF file to JSON.

VS Code result.json screenshot
Screenshot of the JSON file
{
  "document": {
    "page": {
      "@index": "0",
      "row": [
        {
          "column": [
            {
              "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"
              }

If you’ll take a closer look at the JSON result, you will see that the text Your Company Name has an Arial font name, a 24 font size, a Bold font style, a #538DD3 color, a 36 x and 34.44 y coordinates, a 242.81 width, and a 24 height.

Here you’ve learned how to extract font from PDF using PDF.co and Zapier integration when extracting text from PDF files.

Video Guide