GetTextFromPDF

Returns the text found in a PDF file in the specified container field.

Format 

GetTextFromPDF ( container )

Parameters 

container - any expression that returns container data for a PDF file.

Data type returned 

text

Originated in version 

22.0

Description 

Use this function to get the text from a PDF file stored in a container field. This can be very useful for:

  • Indexing the content of stored PDF files for searching within your FileMaker Pro file.

  • Automating data entry by returning specific text out of standardized PDF forms or reports.

  • Analyzing text within a collection of PDF documents without needing external tools or manual copying and pasting.

Notes 

  • The quality of the returned text depends on the quality and structure of the source PDF file. Formatting such as fonts, colors, sizes, and exact layout is not preserved in the returned text.

  • Text in bitmapped images formats, such PNG or JPG, isn't returned from the PDF file.

  • This function returns "?" if:

    • The container field is empty, doesn't contain a PDF file, or no text is found.

    • The PDF file is a scanned document.

    • The PDF file is password-protected or can't be read for any reason.

Example 1 

GetTextFromPDF ( Table::Container ) returns plain text like the following when the Table::Container field contains a PDF file of this page.

Copy
Claris FileMaker Pro Help
Reference>Functions reference>Container functions>GetTextFromPDF
GetTextFromPDF
Returns the text found in a PDF file in the specified container field.
Format
...

Example 2 

In a table named Contracts with a container field ContractPDF that stores PDF files of contracts, a calculation field named ContainsNDA is set to:

Copy
Let (
    pdfText = GetTextFromPDF ( Contracts::ContractPDF ) ; 
    PatternCount ( pdfText ; "Non-Disclosure Agreement" ) > 0 
)

In every record where the PDF file in Contracts::ContractPDF contains the phrase "Non-Disclosure Agreement," the ContainsNDA field will be set to 1 (True). To quickly find all contracts that contain the specific phrase "Non-Disclosure Agreement" without manually opening each PDF file, perform a find where the ContainsNDA field is equal to 1.