BLOGS

Extract PDF Content using ConvertAPI
Justification of Topic:

ConvertAPI is used to extract the text content from a scanned copy of a PDF file in FileMaker. We have achieved this using the cURL function, therefore it will work only for the FileMaker version 16 and above applications.

Introduction:

Some of our customers need to extract the text content from a list of scanned PDF files and then the extracted text should be processed and entered on different tables. If we do this task manually, it will be a time-consuming process and manual errors may occur.

To avoid the above-mentioned issues, we have found a solution to extract the text content from a scanned pdf using CovertAPI. When we call the ConvertAPI using the FileMaker cURL function, It will extract the text content from the PDF file and will provide the result in the JSON format. We can then process that JSON data using FileMaker JSON functions and then the extracted text content can be used in our application as per our needs.

Steps to extract the content from the PDF using ConvertAPI.

STEP 1: CREATE AN ACCOUNT ON THE CONVERTAPI WEBSITE.

  • Create an account in https://www.convertapi.com/ website and note the “Secret key” from “My Dashboard”.

Step 2:

  • In FileMaker Database, create a Container Field and insert a scanned PDF Document.
  • Create a script to extract the content from the PDF using the Convert API cURL.
  • In that script, create a Variable to store the name of the pdf file, available in the container field. The Variable name must end with (.pdf) ex: $FileToExtract.pdf
  • Set a variable for the following URL (ex: $URL)
      “https://v2.convertapi.com/convert/pdf/to/txt?Secret= Insert Secret Key”
  • Set a variable for the following cURL, (ex: $CURL)
      “-F file=@$FileToExtract.pdf
      -F \”AutoRotate=true\””
  • Add “Insert from URL” step, here in “Specify URL”,
      Set Specify URL = $URL (URL variable)
      Set Specify cURL Options = $CURL (cURL variable).
  • Finally, in the Text field, add a step to get the Extracted text from the JSON output and Decode it, like following,
      Base64Decode ( JSONGetElement ( $Result ; “Files[0]FileData” ) )
  • After executing the above script, it will extract text from JSON output and Decode it and then store it in the text field, like below.

Conclusion:

In conclusion, The team at FMDBSolutions hopes this article taught about extract the content from pdf using ConvertAPI cURL. FMDBSolutions is a team of well-qualified experts that have a lot of experience with the many versions of FileMaker Pro and the FileMaker Go app too.

Our team knows all about transitioning, migrating, converting, and upgrading for FileMaker. Companies that require FileMaker Integration can also use our services. Naethra Technologies Pvt Ltd have worked with clients from the USA, Australia, and Singapore and will complete your FileMaker assignment in the best possible way at a lower price but at the same or higher level of excellence.