Components | All | New | MacOS | Windows | Linux | iOS | ||||
Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old |
DynaPDF.FlattenAnnots
Flatten annotations.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
DynaPDF | 4.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
Parameters
Parameter | Description | Example |
---|---|---|
The PDF reference returned from DynaPDF.New. | ||
Flags | The flags as text or number. Default is None. Can be None, UseViewState, MarkupAnnots or both combined as VisibleMarkupAnnots. |
"UseViewState" |
Result
Returns number or error message.
Description
Flatten annotations.Draws all annotations according to the used flags on the corresponding pages and deletes the annotations when finish. The flatten flags can be combined. The flag MarkupAnnots causes that non-markup annotations will be left intact (all kind of link, sound, and file attach annotations).
The function flattens only annotations which contain an appearance stream. The function does not create missing appearances on demand.
If the function succeeds the return value is the number of annotations which are still in memory.
By default all annotations which have an appearance stream and which have the print flag set are flattened. All annotations are deleted when the function returns with the exception of file attachment annotations. If you want to flatten the view state then set the flag affUseViewState.
Flag Name | Flag Number | Description |
None | 0 | Printable annotations independent of type. |
UseViewState | 1 | If set, annotations which are visible in a viewer become flattened. |
MarkupAnnots | 2 | If set, markup annotations are flattened only. Link, Sound, or FileAttach annotations are no markup annotations. Such types will be left intact. |
NonPDFA_1 | 4 | If set, flatten all annotations which are not supported in PDF/A 1. |
NonPDFA_2 | 8 | If set, flatten all annotations which are not supported in PDF/A 2 or 3. |
FormFields | 16 | If set, form fields will be flattened too. |
UseFieldViewState | 32 | Meaningful only if affFormFields or affSigFields is set. If set, flatten the view state of form fields. Use the print state otherwise. |
SigFields | 64 | Meaningful only if affFormFields is not set. If set, signature fields with an appearance stream will be flattened. |
KeepLinkAnnots | 4096 | If set, link annotations will be kept. |
KeepFileAttach | 8192 | If set, file attachment annotations will be kept. |
KeepTextAnnots | 16384 | If set, text annotations will be kept. |
KeepEmptySigFields | 32768 | If set, signature fields which are not already signed will be kept. |
KeepUnsupportedAnnots | 65536 | If set, annotations whose appearance stream cannot be rebuild will be kept (3D, Movie, Redact, or RichMedia annotations, for example). |
PreserveZOrder | 4194304 | If set, preserve the z-order under any circumstances. That means visible overlapping annotations or form fields will be flattened, regardless the type. |
See also FlattenAnnots function in DynaPDF manual.
Examples
Flatten annotations and form fields:
# Initialize DynaPDF if needed
If [ MBS("DynaPDF.IsInitialized") ≠ 1 ]
Perform Script [ Specified: From list ; “InitDynaPDF” ; Parameter: ]
End If
#
# New PDF environemnt
Set Variable [ $pdf ; Value: MBS("DynaPDF.New") ]
# Load PDF from container
Set Variable [ $r ; Value: MBS("DynaPDF.OpenPDFFromContainer"; $pdf; MyTable::Input PDF) ]
Set Variable [ $r ; Value: MBS("DynaPDF.ImportPDFFile"; $pdf; 1) ]
# Flatten annotations
Set Variable [ $r ; Value: MBS( "DynaPDF.FlattenAnnots"; $PDF ) ]
# and the form fields
Set Variable [ $r ; Value: MBS( "DynaPDF.FlattenForm"; $PDF ) ]
# Save
Set Field [ MyTable::Output PDF ; MBS("DynaPDF.Save"; $pdf; "Merged.pdf") ]
Set Variable [ $r ; Value: MBS("DynaPDF.Release"; $pdf) ]
See also
- DynaPDF.FlattenForm
- DynaPDF.ImportPDFFile
- DynaPDF.IsInitialized
- DynaPDF.New
- DynaPDF.OpenPDFFromContainer
- DynaPDF.Release
- DynaPDF.Save
Release notes
- Version 14.3
- Added KeepUnsupportedAnnots option for DynaPDF.FlattenAnnots function.
Example Databases
Blog Entries
- Neues MBS Plugin 14.3 für Claris FileMaker
- MBS FileMaker Plugin 14.3 for Claris FileMaker
- MBS FileMaker Plugin, version 14.3pr3
- DynaPDF Optimize command
- MBS Filemaker Plugin, version 4.2pr1
This function checks for a license.
Created 18th August 2014, last changed 14th June 2024