In this post, we will talk about how to extract the text content from a scanned copy of a PDF file in FileMaker using ConvertAPI. We have achieved this using the cURL function, therefore it will work only for the FileMaker version 16 and above applications.
Overview:
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 by manual, 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 need.
Steps to extract the content from the PDF using ConvertAPI.
Step 1: Create an Account in 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
The team at FMDBSolutions hopes this article taught to you how to extract the content from the 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. We 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 the same or higher level of excellence.
If you want solutions to your FileMaker database, we can help. Click the below box for a free FileMaker consultation
You can also leave us your email below for receiving new updates regarding FileMaker and our company.