Skip to main content

TrFile_GetAsPlainText (function reference)

Troi File Plug-in > Functions reference > TrFile_GetAsPlainText
Troi File Plug-in for FileMaker Pro


Returns the text contents of a PDF file converted to plain text

SyntaxFunction badge

TrFile_GetAsPlainText( switches ; filePath ) 


switches not used, reserved for future use. Leave blank or put "-Unused"
filePath the path to the file, or container data

Returned Result

Data type returned



The characters of the file specified.

If unsuccessful this function returns an error code starting with $$ and the error code. Returned error codes can be:

$$-50 paramErr parameter error
$$-41 memFulErr not enough memory

Other errors may be returned.

Originated in

Troi File Plug-in 13.0


FileMaker Pro 16 to FileMaker Pro 2023


The function currently only converts PDF files to text.
Note that the returned results might be slightly different on macOS compared to Windows: long lines might be wrapped differently.
Each page is separated by: “<———->”
Also note this is implemented for 64-bit FileMaker Pro only.

Starting with v13.1 you now get the plain text from a PDF in a container field (or a variable with container data of a PDF).


Set Field [ MyTextField ; TrFile_GetAsPlainText ( "-Unused" ; "HD Mac:Letter123.pdf" ) ]

returns the contents of the PDF file as plain text.

Example 2

Set Variable[$ContainerWithPDF; ContainerField ]
Set Variable[$PlainText; TrFile_GetAsPlainText("-Unused" ; $ContainerWithPDF) ]

If ContainerField contains a PDF with 2 pages, for example with the text “ABC” on the first page and “1234” on the second the result will be:


Used in example file


Related functionsFunction badge


Related topics

Troi File Plug-in online help (overview)

Online Help Page for Troi File Plug-in for 16 to 2023 –> TrFile_GetAsPlainText (filep4327) 2023-0601 15:21:48