Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   Crossplatform   Server (Not)   Client   Components   Old   Guides
New in version: 5.0   5.1   5.2   5.3   5.4   6.0   6.1   6.2   6.3   6.4   6.5   7.0   7.1    Statistic  

DynaPDF.ExtractText

Extracts the text of all pages.

Component: DynaPDF
Version: 6.0
Mac OS X: Yes
Windows: Yes
Server: Yes
FileMaker Cloud: Yes

MBS( "DynaPDF.ExtractText"; PDF )

Parameters

Parameter Description Example value
PDF The PDF reference returned from DynaPDF.New. $pdf

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.ExtractPageText is you need text from just one page.

For Mac only solutions, you can also try PDFKit.GetPDFText.

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.ExtractText"; $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.ExtractText"; $pdf)]
            Commit Records/Requests [No dialog]
        End If
    End If
    #Cleanup
    Set Variable [$r; Value:MBS("DynaPDF.Release"; $pdf)]
End If

See also


DynaPDF.ExtractPageText   -   DynaPDF.FileAttachAnnot

Feedback: Report problem or ask question.




Links
MBS Realbasic Plugins - Nachhilfe in Plaidt