Components | All | New | MacOS | Windows | Linux | iOS | ||||
Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old |
DynaPDF.SetImportFlags
The function sets optional flags to control the import of external PDF files.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
DynaPDF | 4.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
Parameters
Parameter | Description | Example |
---|---|---|
The PDF reference returned from DynaPDF.New. | ||
Flags | The new flags value. | 268435454 |
Result
Returns OK or error.
Description
The function sets optional flags to control the import of external PDF files.By default the plugin uses ifImportAll combined with ifImportAsPage.
Flag Description
ImportAll | 268435454 | If set, all objects of an external PDF file are imported. |
ContentOnly | 0 | If set, interactive objects such as annotations, bookmarks or form fields are excluded from import. |
NoContent | 1 | If set, the visual contents of external pages will not be imported. This flag can be used to copy interactive objects from one file into another, such as interactive form fields. |
ImportAsPage | 2147483648 | If set, pages are not converted to templates. This flag is useful if an imported page must not be used multiple times. Conversion to templates is recommended if multiple imported pages should appear on the same page; such overlapping pages can cause resource conflicts which produces unpredictable output. |
CatalogAction | 2 | If set, catalog actions will be imported if any. The documents catalog is the root object of a PDF file, which can trigger actions when the file will be opened, closed, or printed. See AddActionToObj() for further information. |
PageActions | 4 | If set, page actions are imported if any. A page action is an action that was added to the page itself, not an object of a page. |
Bookmarks | 8 | If set, bookmarks are imported if any. |
Articles | 16 | If set, Articles are imported if any. |
PageLabels | 32 | If set, page labels are imported if any. If multiple files are imported, DynaPDF imports the page labels of the first file only. |
Thumbs | 64 | If set, thumb nail images are imported if any. Thumb nails can be dynamically created by Acrobat since Acrobat 5. The thumb nail images can be removed to reduce disk space. |
TranspGroups | 128 | If set, transparency groups are imported if any. If transparency groups are removed the objects appear then opaque. |
SeparationInfo | 256 | If set, the separation information dictionary will be imported if any. |
BoxColorInfo | 512 | If set, the bounding boxes artbox, bleedbox and trimbox are shown in user defined color. Note that the cropbox represents the current page; the page is already cropped if a cropbox was defined. |
StructureTree | 1024 | If set, structure trees are imported if any. A structure tree contains information about the logical structure of a document. This information can be used by screen readers and other accessibility plug-ins to enable certain features. The information of a structure tree is not required to view or print a PDF document. |
Transition | 2048 | If set, transition settings are import. A transition dictionary contains information about how a presentation should be displayed. These settings can be removed if the document should not be used in presentation mode. |
SearchIndex | 4096 | If set, the file path to an external search index will be imported if any. |
JavaScript | 8192 | If set, global JavaScripts are imported if any. Note that JavaScript actions can use the functions defined in global JavaScripts. If these scripts are removed, JavaScript actions must normally also removed to avoid errors. However, it is often useful to remove the scripts for certain debug operations. |
JSActions | 16384 | If set, JavaScript actions are imported if any. This flag is useful if an imported form contains JavaScripts which produces errors or warnings. For instance, a document can define certain scripts which may require specific settings such as a document info string and so on. It is then often difficult to determine which object produces the error or warning because it can be a JavaScript action or a global JavaScript. In such cases, JavaScript actions can be excluded temporarily to check whether the error still occurs. |
DocInfo | 32768 | If set, document info entries are imported if any. Already existing entries are not overridden. |
EmbeddedFiles | 2097152 | If set, embedded files are imported. |
FileCollections | 4194304 | If set, the global definition of a collection is imported. The file attachments are still imported if the flag ifEmbeddedFiles is set. The PDF file is simply not longer marked as portable collection, also known as PDF Package. See also DynaPDF.CreateCollection. |
AllAnnots | 10420224 | If set, all types of annotations are imported. |
FreeText | 65536 | This flag is meaningful only if the flag ifAllAnnots is clear. If set, FreeText annotations are imported if any. |
TextAnnot | 131072 | This flag is meaningful only if the flag ifAllAnnots is clear. If set, text annotations are imported if any. |
Link | 262144 | This flag is meaningful only if the flag ifAllAnnots is clear. If set, link annotations are imported if any. This annotation type is used for weblinks, page links, and file links. |
Stamp | 524288 | This flag is meaningful only if the flag ifAllAnnots is clear. If set, stamp annotations are imported if any. |
3DAnnot | 1048576 | This flag is meaningful only if the flag ifAllAnnots is clear. If set, 3D annotations are imported if any. |
OtherAnnots | 8388608 | This flag is meaningful only if the flag ifAllAnnots is clear. If set, other annotation types as the ones listed above are imported if any. |
FormFields | 16777216 | If set, interactive form fields are imported if any (also called AcroForm). Form fields are also annotations, but this type is handled separately. |
PrepareForPDFA | 268435456 | If set, LZW compressed streams are recompressed with Flate, the Interpolate key of images is deleted if set, embedded files are not imported. |
EnumFonts | 536870912 | If set, only font objects are imported to enable high performance enumeration of the fonts used in a PDF file. The PDF file must be deleted with FreePDF() after the fonts were enumerated. See DynaPDF.EnumDocFonts for further information. |
AllPageObjects | 1073741824 | If set, all types of link annotations are imported when importing a page within an open page with ImportPageEx(). The entire document should be imported in this case. |
See also SetImportFlags function in DynaPDF manual.
Examples
Set import flags:
MBS( "DynaPDF.SetImportFlags"; $PDF; 268435454 + 2147483648 )
Set import flags with names:
MBS( "DynaPDF.SetImportFlags"; $pdf; "ImportAll¶ImportAsPage¶PrepareForPDFA" )
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.GetImportFlags
- DynaPDF.GetImportFlags2
- DynaPDF.New
- DynaPDF.OpenPDFFromContainer
- DynaPDF.OpenPDFFromFile
- DynaPDF.Save
- DynaPDF.SetAnnotFlags
- DynaPDF.SetFieldFlags
- DynaPDF.SetGStateFlags
- DynaPDF.WebLink
Release notes
- Version 13.4
- Added SkipDPartData option for DynaPDF.SetImportFlags2 function.
Example Databases
- DynaPDF/Add Page Numbers
- DynaPDF/Add Weblinks
- DynaPDF/Convert to PDFA
- DynaPDF/Invoice/Invoice
- DynaPDF/List ColorSpaces
- DynaPDF/PDF Library
- DynaPDF/Personalized PDFs
- DynaPDF/ZUGFeRD/ZUGFeRD Invoice
- DynaPDF/ZUGFeRD 2.0/ZUGFeRD 2.0 Invoice
- DynaPDF/ZUGFeRD
Blog Entries
- Example Script for DynaPDF.FindText and DynaPDF.WebLink
- FileMaker with ZUGFeRD 2.0 and Factur-X
- How to Convert a PDF document to a PDF/A
- Creating PDF/A in FileMaker with ZUGFeRD standard
- Creating PDF/A in FileMaker with ZUGFeRD standard
- MBS FileMaker Plugin, version 6.1pr2
- MBS Filemaker Plugin, version 4.1pr4
FileMaker Magazin
This function checks for a license.
Created 18th August 2014, last changed 27th May 2017