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
Annotations inside a PDF document have a number of different properties that define how they are rendered. For example their fill and stroke color, opacity, stroke thickness, etc. Annotations can also define an appearance (AP key in the PDF spec). An appearance is basically a set of drawing instructions that should be used to render an annotation’s appearance and any properties (other than the position) should be ignored.
Note that appearances are drawn by default, but they are not always present and can sometimes be different than how we expect an annotation to appear based on the properties alone.
By default WebViewer will export an appearance as a reference to the object number in the PDF that the annotation exists in. Since it doesn't include the entire appearance data this means the XFDF string is much shorter. However this also means that if you try to import this XFDF into a different document then the appearance reference will no longer exist and the appearance will not be shown.
WebViewer provides an option to exportAnnotations
called generateInlineAppearances
. When this option is used then the entire appearance data will be included inline in the XFDF string. This means that if you import the string into another PDF file it will work just fine. However this also means that the XFDF string will be quite a bit longer.
The following code snippet can be used to export annotations with inline appearances.
As an example if you only wanted to export the XFDF for callout annotations and include the inline appearances you could do it like this.
If you are using the full API with a PDFDoc
object then inline appearances can be generated using the code below.
After exporting the XFDF it can be imported back into WebViewer using any of the normal importing functions. For example you can use importAnnotations as shown below
Note that custom appearances can't currently be exported inline. See guide for more information about custom appearances.
Did you find this helpful?
Trial setup questions?
Ask experts on DiscordNeed other help?
Contact SupportPricing or product questions?
Contact Sales