Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

WinPDF.LoadFile

Loads a PDF document from file synchronously.

Component Version macOS Windows Linux Server iOS SDK
WinPDF 13.2 ❌ No ✅ Yes ❌ No ✅ Yes, on Windows ❌ No
MBS( "WinPDF.LoadFile"; Path { ; Password } )   More

Parameters

Parameter Description Example Flags
Path Native file path to the PDF file. "C:\test\test.pdf"
Password The password to open the Portable Document Format (PDF) document, if it requires one. Optional

Result

Returns reference number or error.

Description

Loads a PDF document from file synchronously.
Requires Windows 10 or newer.

If the Portable Document Format (PDF) document does not require a password, this method ignores it.
This method reports an ERROR_WRONG_PASSWORD (1323) error if the wrong password is specified.

This function requires a native path. Use Path.FileMakerPathToNativePath to convert a FileMaker path to a native path if required. If you like to have the user choose the path, you can use FileDialog functions.
For Server be aware that server has limited permissions and may not be able to access all files on a computer.

Examples

Load a PDF from disk:

Set Variable [ $pdf ; Value: MBS( "WinPDF.LoadFile"; "C:\test\test.pdf" ) ]
If [ MBS("IsError") ]
    Show Custom Dialog [ "Failed to open PDF." ; $pdf ]
    Exit Script [ Text Result: ]
End If

See also

Blog Entries

This function checks for a license.

Created 8th March 2023, last changed 7th May 2023


WinPDF.LoadContainer - WinPDF.PageBox