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
Annotation classes understand how to serialize their properties into XFDF according to the XFDF specification. This can be customized in WebViewer to serialize custom properties and read those properties back in. This is especially useful when storing the XFDF externally, as custom attributes/elements outside the specification will be ignored by WebViewer when used to save to the document.
The APIs in this guide are only available in WebViewer 7.1+.
To change the serialization behavior for an annotation class, you can use the setCustomSerializeHandler API.
To change an annotation class to read custom attributes/elements in the XFDF, you can use the setCustomDeserializeHandler API to change that behavior.
Both APIs, setCustomSerializeHandler and setCustomDeserializeHandler, require new, custom function handlers to be provided. They are similar to the serialize
and deserialize
functions on annotations except with an additional options
parameter.
The options
parameter contains the annotation being serialized/deserialized. It also includes the original serialize and deserialize functions, originalSerialize
and originalDeserialize
, so that you can perform regular operations and then building on top of existing functionality.
When customizing annotation serialization and/or deserialization, the original respective function is preserved. Calling an API to change the behavior again will not overwrite the original, preserved function. This allows the original behavior of the annotation to be restored when you want to restore the original behavior.
Change how annotations render using your custom properties.
Did you find this helpful?
Trial setup questions?
Ask experts on DiscordNeed other help?
Contact SupportPricing or product questions?
Contact Sales