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.5
10.0
10.1
10.2
10.3
10.4
10.5
11.0
11.1
11.2
Statistic
FMM
Blog
Sets optional flags to control the import of external PDF files.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
DynaPDF | 4.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
Parameter | Description | Example |
---|---|---|
flags | The new import flags. | 16 |
Returns OK.
MergeLayers | 1 | If set, layers with identical name are merged. If this flag is absent DynaPDF imports such layers separately so that each layer refers still to the pages where it was originally used. |
Normalize | 2 | Replace LZW compression with Flate, apply limit checks, repair errors if possible |
UseProxy | 4 | Not meaningful for PDF files which are loaded from a memory buffer. If set, all streams are loaded from the file on demand but they are never hold in memory. This reduces drastically the memory usage and enables the processing of almost arbitrary large PDF files with minimal memory usage. The corresponding PDF file must not be deleted before DynaPDF.CloseFile or DynaPDF.CloseFileEx was called. |
NoMetadata | 8 | Ignore metadata streams which are attached to fonts, pages, images, and so on. |
DuplicateCheck | 16 | Perform a duplicate check on color spaces, fonts, images, patterns, and templates when merging PDF files. |
See also SetImportFlags2 function in DynaPDF manual.
Activate duplicate check to reduce file size:
MBS("DynaPDF.SetImportFlags2"; $pdf; 16)
Activate normalization, duplicate check and layer merge:
MBS( "DynaPDF.SetImportFlags2"; $pdf; "MergeLayers¶Normalize¶DuplicateCheck" )
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)]
Created 18th August 2014, last changed 27th May 2017
DynaPDF.SetImportFlags - DynaPDF.SetJPEGQuality
Feedback: Report problem or ask question.