Topics
All
MacOS
(Only)
Windows
(Only)
Linux
(Only, Not)
iOS
(Only, Not)
Components
Crossplatform Mac & Win
Server
Client
Old
Deprecated
Guides
Examples
Videos
New in version:
9.3
9.4
9.5
10.0
10.1
10.2
10.3
10.4
10.5
10.6
Statistic
FMM
Blog
DynaPDF.ImportPDFFile
Imports all pages from a file.
| Component | Version | macOS | Windows | Linux | Server | FileMaker iOS SDK |
| DynaPDF | 3.0 | Yes | Yes | Yes | Yes | Yes |
Parameters
| Parameter | Description | Example |
|---|---|---|
| The PDF reference returned from DynaPDF.New. | ||
| DestPage | The first number of the first imported page. Use this to insert pages at some position in new PDF. Default is 1. | 1 |
Result
Returns error message or last page number.
Description
Imports all pages from a file.The function imports an external PDF file including interactive objects such as annotations, bookmarks, form fields, and so on. DynaPDF supports a large set of flags to enable import of required objects only. Unwanted objects can be removed by the function if necessary.
The parameter DestPage specifies the destination page on which the new pages will be inserted or added if the pages already exist. It is possible to import multiple PDF files on the same or overlapping destination page.
If the function succeeds the return value is the last page number that was touched. For example, if the document in memory contains already 20 pages, and if we import a PDF file with 23 pages, and if the destination page is 21 the return value should be 43 because this is the last page that was invoked during import.
If the function fails the return value is a negative error code.
To open the import PDF, please use DynaPDF.OpenPDFFromFile or DynaPDF.OpenPDFFromContainer.
See also ImportPDFFile function in DynaPDF manual.
Examples
Imports all pages from import PDF and put in current PDF starting at page 5
$r = MBS( "DynaPDF.ImportPDFFile"; $PDF; 5 )
Load PDF and extract text of page 2:
# initialize DynaPDF before running this:
Set Variable [$pdf; Value:MBS("DynaPDF.New")]
# load PDF from container
Set Variable [$r; Value:MBS("DynaPDF.OpenPDFFromContainer";$pdf; Test::data)]
# import all pages
Set Variable [$r; Value:MBS("DynaPDF.ImportPDFFile";$pdf)]
# extra text of page 2
Set Field [Test::PageText; MBS("DynaPDF.ExtractPageText"; $pdf; 2)]
#Cleanup
Set Variable [$r; Value:MBS("DynaPDF.Release"; $pdf)]
Import and Export PDF:
# Start new PDF
Set Variable [$pdf; Value:MBS("DynaPDF.New")]
# set import flags
Set Variable [$r; Value:MBS( "DynaPDF.SetImportFlags"; $pdf; "ImportAll ImportAsPage PrepareForPDFA" )]
Set Variable [$r; Value:MBS( "DynaPDF.SetImportFlags2"; $pdf; "DuplicateCheck" )]
# Import PDF from container
Set Variable [$r; Value:MBS("DynaPDF.OpenPDFFromContainer"; $pdf; MyTable::InputPDF)]
Set Variable [$r; Value:MBS("DynaPDF.ImportPDFFile"; $pdf; 1)]
# Save back
Set Field [MyTable::OutputPDF; MBS("DynaPDF.Save"; $pdf; "Merged.pdf")]
Set Variable [$r; Value:MBS("DynaPDF.Release"; $pdf)]
See also
- DynaPDF.ImportPDFPage
- DynaPDF.PageStatistics
- DynaPDF.Print
- DynaPDF.Print.SetDevMode
- DynaPDF.Release
- DynaPDF.RenderPDFFile
- DynaPDF.Save
- DynaPDF.SetMetadata
- DynaPDF.SetOrientationEx
- DynaPDF.WebLink
Example Databases
- Barcode/QRCode PDF
- DynaPDF/Add Page Numbers
- DynaPDF/DynaPDF Test
- DynaPDF/List Images
- DynaPDF/List XFA Streams
- DynaPDF/PDF Font Info
- DynaPDF/Personalized PDFs
- DynaPDF/Watermark pages
- DynaPDF/ZUGFeRD/ZUGFeRD Invoice
- DynaPDF/ZUGFeRD 2.0/ZUGFeRD 2.0 Invoice
Blog Entries
- Example Script for DynaPDF.FindText and DynaPDF.WebLink
- Merge PDF with table of contents
- FileMaker with ZUGFeRD 2.0 and Factur-X
- How to Convert a PDF document to a PDF/A
- MBS FileMaker Plugin, version 8.3pr5
- PDF Forms with MBS Plugin
- Creating PDF/A in FileMaker with ZUGFeRD standard
- Creating PDF/A in FileMaker with ZUGFeRD standard
- Custom function to optimize PDF in FileMaker via DynaPDF
- Optimize PDF Script
FileMaker Magazin
- Ausgabe 6/2020, Seite 33
- Ausgabe 3/2019, Seite 37, PDF
- Ausgabe 2/2019, Seite 27, PDF
- Ausgabe 2/2019, Seite 26, PDF
- Ausgabe 1/2018, Seite 26, PDF
- Ausgabe 1/2018, Seite 24, PDF
- Ausgabe 6/2017, Seite 26, PDF
- Ausgabe 6/2016, Seite 24
Release notes
- Version 8.3
- Changed DynaPDF.ImportPDFFile to close open page before importing to avoid error.
Created 18th August 2014, last changed 27th May 2017
DynaPDF.ImportEncryptionSettings - DynaPDF.ImportPDFPage
Feedback: Report problem or ask question.
Links
MBS FileMaker Plugins