Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old


Creates a user defined appearance stream for an annotation.

Component Version macOS Windows Linux Server iOS SDK
DynaPDF 13.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "DynaPDF.CreateAnnotAP"; PDF; AnnotationHandle )   More


Parameter Description Example
PDF The PDF reference returned from DynaPDF.New. $pdf
AnnotationHandle The annotation index. 5


Returns number or error.


Creates a user defined appearance stream for an annotation.
This function creates a user defined appearance stream for an annotation and activates it so that arbitrary contents can be drawn into it, such as text, images, or vector graphics. An appearance stream is a normal template in the size of the annotation. The template must be closed when finish with DynaPDF.EndTemplate.
Note that the template is reserved for the annotation and must not be used on pages or other templates.
At time of publication user defined appearance streams can be created for Stamp and FreeText annotations. However, the main application is the creation of user defined stamps. The appearance stream of a FreeText annotation should correspond to the annotation's value.
It is allowed to insert an EMF file into a user defined appearance stream. If the contents should be imported from an external PDF file then import the wished page with DynaPDF.ImportPage and place the resulting template into this one with DynaPDF.PlaceTemplate or DynaPDF.PlaceTemplateEx. The latter version is preferred because it considers the original page orientation and bounding boxes. See DynaPDF.PlaceTemplateEx for further information.
If the function succeeds the return value is the handle of the template that was created for the annotation, a value greater or equal zero. If the function fails the return value is a negative error code.

See also CreateAnnotAP function in DynaPDF manual.


Try it:

Set Variable [ $customField ; Value: MBS( "DynaPDF.StampAnnot"; $pdf; "UserDefined"; 100; 100; 200; 80; "Test"; "Test") ]
# add content for custom stamp annotation
Set Variable [ $r ; Value: MBS( "DynaPDF.CreateAnnotAP"; $PDF; $customField) ]
# draw something here
Set Variable [ $r ; Value: MBS( "DynaPDF.EndTemplate"; $PDF) ]

See also

Release notes

Example Databases

Blog Entries

This function checks for a license.

Created 12nd May 2023, last changed 14th May 2023

DynaPDF.CreateAltFontList - DynaPDF.CreateAxialShading