Components | All | New | MacOS | Windows | Linux | iOS | ||||
Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old |
DynaPDF.ExtractDocumentText
Extracts the text of all pages.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
DynaPDF | 6.0 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
Parameters
Parameter | Description | Example | Flags |
---|---|---|---|
The PDF reference returned from DynaPDF.New. | |||
Flags | Available in MBS FileMaker Plugin 14.4 or newer. The flags for text extraction. Can include Default, SortTextX, SortTextY, SortTextXY, DeleteOverlappingText and/or NoHeuristic. Usually you may want to use SortTextX here. The flag MediaBox limits text extraction to the media box. The flag CropBox uses the crop box (if missing media box) for the rectangle. |
"SortTextX" | Optional |
Result
Returns text or error.
Description
Extracts the text of all pages.This is like extracting page by page, but plugin may do it faster than a loop in a FileMaker script and puts a newline between pages.
Use DynaPDF.ExtractText is you need text from just one page.
For Mac only solutions, you can also try PDFKit.GetPDFText.
Needs DynaPDF Lite license.
Please use DynaPDF.SetCMapDir to define the CMap folder to handle encodings better.
If you have an open page, we close it automatically for you before doing the import.
Examples
Load PDF and extract text:
Set Variable [$pdf; Value:MBS("DynaPDF.New")]
Set Variable [$r; Value:MBS("DynaPDF.OpenPDFFromContainer";$pdf; Test::data)]
Set Variable [$r; Value:MBS("DynaPDF.ImportPDFFile";$pdf)]
Set Field [Test::PageText; MBS("DynaPDF.ExtractDocumentText"; $pdf)]
Set Variable [$r; Value:MBS("DynaPDF.Release"; $pdf)]
Full script to get text with error checking:
If [MBS("DynaPDF.IsInitialized") ≠ 1]
Perform Script [“InitDynaPDF”]
End If
Set Variable [$pdf; Value:MBS("DynaPDF.New")]
If [MBS("IsError")]
Show Custom Dialog ["DynaPDF Fehler"; $pdf]
Else
Set Variable [$r; Value:MBS("DynaPDF.OpenPDFFromContainer";$pdf; Test::data)]
If [MBS("IsError")]
Show Custom Dialog ["DynaPDF Fehler"; $r]
Else
Set Variable [$r; Value:MBS("DynaPDF.ImportPDFFile";$pdf)]
If [MBS("IsError")]
Show Custom Dialog ["DynaPDF Fehler"; $r]
Else
Set Field [Test::PageText; MBS("DynaPDF.ExtractTextOld"; $pdf)]
Commit Records/Requests [No dialog]
End If
End If
#Cleanup
Set Variable [$r; Value:MBS("DynaPDF.Release"; $pdf)]
End If
See also
- DynaPDF.ExtractDocumentTest
- DynaPDF.ExtractPageRectText
- DynaPDF.ExtractPageText
- DynaPDF.ImportPDFFile
- DynaPDF.IsInitialized
- DynaPDF.New
- DynaPDF.OpenPDFFromContainer
- DynaPDF.SetCMapDir
- IsError
- PDFKit.GetPDFText
Release notes
- Version 15.1
- Added flags MediaBox and CropBox to DynaPDF.Parser.ExtractText, DynaPDF.ExtractText and DynaPDF.ExtractDocumentText.
- Version 14.4
- Added Flags parameter for DynaPDF.ExtractDocumentText function.
- Version 14.0
- Rewrote DynaPDF.ExtractDocumentText using newer DynaPDF.ExtractText function internally.
- Version 10.1
- Fixed a problem with recursive templates in DynaPDF.ExtractDocumentText, DynaPDF.ExtractPageRectText and DynaPDF.ExtractPageText functions.
- Version 8.0
- Renamed existing DynaPDF.ExtractText to DynaPDF.ExtractDocumentText. New function does the same, but now part of DynaPDF itself and not a helper function from our plugin.
Example Databases
Blog Entries
- MBS FileMaker Plugin, version 15.1pr1
- MBS FileMaker Plugin, version 14.4pr3
- MBS FileMaker Plugin, version 14.0pr7
- MBS FileMaker Plugin, version 10.1pr5
FileMaker Magazin
This function checks for a license.
Created 8th December 2015, last changed 31st January 2025
