Step by step guide:

1. 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.

Source PDF To Extract Font Details

Screenshot of Source PDF

2. Let’s jump straight to Step 2 and set up PDF.co. 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.

Setup PDF To Anything Converter As The Action Step

3. Next, let’s configure the PDF to Anything Converter.

  • 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.

Configure Anything To PDF Converter With Source PDF URL

Set The OCR Language And File Name

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

Send PDF To Anything Converter Data To Test And Review

5. 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.

PDF.co Processed Request Successfully

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

JSON Output With PDF Font Details
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"
              }

7. 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.

Related Pages:

Related Samples: