Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server (Not)   Client   Old   Guides   Examples
New in version: 6.0   6.1   6.2   6.3   6.4   6.5   7.0   7.1   7.2   7.3    Statistic  

DynaPDF.OpenPDFFromFile

Opens a PDF for importing from a file.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
DynaPDF 3.0 Yes Yes Yes Yes Yes

MBS( "DynaPDF.OpenPDFFromFile"; PDF; Path { ; PasswordType; Password } )

Parameters

Parameter Description Example value
PDF The PDF reference returned from DynaPDF.New. $pdf
Path The path to use. Should contain a PDF file. $path
PasswordType Optional
The password type and flags. Flag kann be 1 for owner password and 0 for open password. You can combine this with 2 to force repair.
0
Password Optional
The password to decrypt the file.
$password

Result

Returns 0, file handle or error message.

Description

Opens a PDF for importing from a file.
Use Path.FileMakerPathToNativePath to convert a FileMaker path to a native path if required.

Requires DynaPDF Lite license.

If the function succeeds the return value is zero or the file handle if the flag UseProxy is set (a value greater or equal zero). If the function fails the return value is an error message.

Examples

Import selected pages from one PDF and write into a new one:

# New PDF
Set Variable [$pdf; Value:MBS("DynaPDF.New")]

# Open existing PDF file (or use DynaPDF.OpenPDFFromContainer for container)
Set Variable [$r; Value:MBS("DynaPDF.OpenPDFFromFile"; $pdf; $path )]

# Query page count
Set Variable [$pageCount; Value:MBS( "DynaPDF.GetImportPageCount"; $pdf )]

# Import the pages you need
Set Variable [$r; Value:MBS("DynaPDF.ImportPDFPage"; $pdf; 1)]
Set Variable [$r; Value:MBS("DynaPDF.ImportPDFPage"; $pdf; 2)]
Set Variable [$r; Value:MBS("DynaPDF.ImportPDFPage"; $pdf; 3)]
Set Variable [$r; Value:MBS("DynaPDF.ImportPDFPage"; $pdf; $pagecount - 1)]
Set Variable [$r; Value:MBS("DynaPDF.ImportPDFPage"; $pdf; $pagecount - 2)]

# Set output to this file path
# MBS( "DynaPDF.OpenOutputFile"; $pdf; "/Users/cs/Desktop/output.pdf" )

# Write PDF
Set Variable [$r; Value:MBS("DynaPDF.Save"; $pdf)]

# release memory
Set Variable [$r1; Value:MBS("DynaPDF.Release"; $pdf)]

See also

Example Databases


DynaPDF.OpenPDFFromContainer   -   DynaPDF.Optimize

Feedback: Report problem or ask question.




Links
MBS Xojo Plugins