Frameworks
Integrations
Mendix
SharePoint
Default UI
Modular UI
AnnotationManager
Annotation Types
Customize
Version 11
Version 10
v10.12
v10.11
v10.10
v10.9
v10.8
v10.7
v10.6
v10.5
v10.4
v10.3
v10.2
v10.1
v10.0
Version 8
v8.12
v8.11
v8.10
v8.9
v8.8
v8.7
v8.6
v8.5
v8.4
v8.3
v8.2
v8.1
v8.0
Version 7
Version 6
v6.3
v6.2
v6.1
v6.0
Version 5
Version 4
Version 3
Version 2
WebViewer Server
WebViewer BIM
Custom annotations are not officially part of the PDF specification, but can be programmatically created through WebViewer and viewed in other viewers as stamp annotations.
Custom annotations in WebViewer allow you to create annotations that will suit your needs and use case. They can have custom rendering and functionality. They can also be preserved in the document to view in other viewers or reloaded in your app without additional conversion. However, they will lose all custom functionality in other viewers since they are custom and only exist in your app.
Check out our custom annotation guide that will guide you through making a custom triangle annotation!
This annotation type is only supported in WebViewer 7.3+.
Element name: stamp
or varies
If you would like to understand why this the type is stamp, then refer to the the Other Notes section.
Gets or sets the page number of a document that the annotation appears on.
For the full list of properties, please visit the annotation's API docs.
A constant of custom annotation serialization method types to use with SerializationType
. Possible values are:
Gets or sets the quality of the annotation when saved as a stamp. The higher the value, the higher the quality and memory usage. The default is 2.
Gets or sets the method this annotation class will be saved with. Possible values can be found on the SerializationTypes
constant. The default is STAMP
.
Gets or sets the additional padding around the custom annotation stamp appearance.
Gets an object that can be used to store primitive, custom data. Data set on this object will be saved to the annotations custom data automatically which gets preserved in the document. This property cannot be initialized through the initializer.
The author of the annotation.
Gets or sets the annotation's stroke color.
Gets or sets whether the annotation is hidden.
Gets or sets whether the annotation is invisible, only if it is an unknown annotation type. Generally for hiding annotations you should use "Hidden".
Gets or sets whether the annotation should be listed in annotation lists. If set to false, the annotation will also become unselectable.
Gets or sets whether the annotation is locked or not. If it's locked it can't be edited or deleted, but the note can be edited.
Gets or sets whether the annotation contents are locked or not. If the contents are locked then note can't be edited but the annotation can be edited or deleted.
Gets or sets if this annotation can be deleted.
Gets or sets if this annotation can be rotated.
Gets or sets whether the annotation is visible on the screen. Differs from Hidden in that it can still be printed if the print flag is set.
Gets or sets if this annotation scales with the page.
Gets or sets the opacity of the annotation.
Gets or sets whether the annotation should be displayed when printing the page.
Gets or sets whether the annotation is readonly or not. If it's readonly both the annotation itself and its note can't be edited or deleted.
Gets or sets whether the ToggleNoView flag is set on the annotation.
If you need to create a custom annotation class based on an existing annotation class, the createFromClass
static, utility function makes it easy. Just provide the new custom element name as well as the base annotation class.
Custom annotations exist outside of the PDF specification. As such, specification compliant viewers will not understand these annotations and ignore them.
WebViewer is a compliant viewer that allows you to support your custom annotations if you wish. WebViewer even allows the annotations to exist in other compliant viewers. This is done by saving it as a stamp, rather than its custom type, which will allow the annotation to appear in other viewers.
When the document is reloaded in WebViewer (where the custom annotation is registered and supported), WebViewer can deserialize the annotation back into its original custom type. This is done through storing the unique element type of the custom annotation in the custom data.
If you would prefer to store the XFDF only, as opposed to a stamp, and would like the custom type to appear in the XFDF, then you can change the static property SerializationType
on the custom annotation class to SerializationTypes.CUSTOM
.
Custom annotations offer a wide possibility of options to work with. It should come without saying that custom annotations can be drawn in various ways as well and possibly beyond it's own bounds. When this happens, the annotation may be clipped after saving as stamp annotations, as the image cannot exist beyond the rectangular bounds of the stamp.
You can use the OutputImagePadding
to pad the annotations of the custom class to ensure the annotation renders in its entirety when saved. However, this adds padding and shrinks the annotation a bit based on the amount of padding added.
Did you find this helpful?
Trial setup questions?
Ask experts on DiscordNeed other help?
Contact SupportPricing or product questions?
Contact Sales