Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Guides   Examples
New in version: 8.1   8.2   8.3   8.4   8.5   9.0   9.1   9.2   9.3   9.4    Statistic  

DynaPDF.SetMetadata

The function sets or replaces the XMP metadata stream of a specific object.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
DynaPDF 5.2 Yes Yes Yes Yes Yes
MBS( "DynaPDF.SetMetadata"; PDF; ObjType; Handle; XMP )   More

Parameters

Parameter Description Example value
PDF The PDF reference returned from DynaPDF.New. $pdf
ObjType The object type. Can be Catalog, Font, Image, Page or Template. "Catalog"
Handle Object handle or -1 for the catalog object. -1
XMP The XMP metadata as text.

Result

Returns OK or error.

Description

The function sets or replaces the XMP metadata stream of a specific object.
The function deletes the XMP stream if no buffer will be provided.
If the global XMP stream of the Catalog object should be replaced then proceed as follows:

The above steps make sure that the XMP metadata and document info contain the same values. This is especially important for PDF standards like PDF/A or PDF/X. DynaPDF makes sure that the creation and modification date will not be changed when closing the file.

See also SetMetadata function in DynaPDF manual.

Examples

Read, change and write XMP metadata:

Variable setzen [ $pdf ; Wert: MBS("DynaPDF.New") ]
# Load PDF from container
Variable setzen [ $r ; Wert: MBS("DynaPDF.OpenPDFFromContainer"; $pdf; Merge PDFs::InputPDF) ]
Variable setzen [ $r ; Wert: MBS("DynaPDF.ImportPDFFile"; $pdf; 1) ]
#
# get current XMP
Variable setzen [ $xmp ; Wert: MBS("DynaPDF.GetMetadata"; $pdf; "catalog"; -1) ]
#
# delete XMP metadata
// Variable setzen [ $r ; Wert: MBS("DynaPDF.SetMetadata"; $pdf; "") ]
#
# or write new XMP metadata
Variable setzen [ $r ; Wert: MBS("DynaPDF.SetMetadata"; $pdf; "catalog"; -1; $XMP) ]
#
# save
Feldwert setzen [ Merge PDFs::FinalPDF ; MBS("DynaPDF.Save"; $pdf; "Merged.pdf") ]
Variable setzen [ $r ; Wert: MBS("DynaPDF.Release"; $pdf) ]

See also

Blog Entries

Created 29th July 2015, last changed 7th March 2019


DynaPDF.SetMetaConvFlags   -   DynaPDF.SetMiterLimit

Feedback: Report problem or ask question.




Links
MBS Xojo PDF Plugins