NotateXpress 13 for .NET - User Guide > How To > Save Annotations > Save Annotations to XFDF |
Annotations are stored to an XFDF file or memory using the same methods as those used for saving annotation data to a .nxp file or memory. Prior to storing the annotations, specify SaveOptions to provide specific saving instructions. Ensure that SaveOptions.AnnType is set to XFDF.
Use the LayerCollection.SaveToFile method to save the layer collection to an annotation file. If the xfdf is a multi-page file, set the PageNumber property to specify to which page annotations should be saved. If the file exists, NotateXpress will append the specified page's annotations with the annotations being saved. NotateXpress will add the annotations, if the page does not exist.
Use the LayerCollection.SaveToByteArray to save annotations to a byte array.
Use the LayerCollection.SaveToMemoryStream to save annotations to a memory stream:
Many of the annotations that can be expressed in NotateXpress have a direct corresponding annotation within XFDF. These annotations are saved to XFDF without modification:
NotateXpress Annotation | XFDF Annotation |
Ellipse | Ellipse |
Rectangle | Rectangle |
Polygon | Polygon |
Line | Line |
Freehand | Ink |
BlockHighlight | Highlight |
Text | FreeText |
Note | Text |
The following NotateXpress annotations do not have a direct equivalent within XFDF. These are translated to XFDF as follows:
NotateXpress Annotation |
XFDF Annotation |
Translation / Modification |
Stamp |
FreeText |
|
Image | Stamp | |
Button | FreeText | |
Ruler | Line | |
Note | Popup | An annotation that is grouped with one Note annotation will be converted to an annotation containing an XFDF popup. This does not apply to an annotation that is converted to an XFDF text or XFDF freetext annotation, as these XFDF annotations do not support containing popup annotations. |
Use the MappingOutput event to access the original NotateXpress X and Y values and the new XFDF mapped X and Y values for an annotation. You can set the new mapped values to modify the position of the saved annotation.
The following NotateXpress supported annotation attributes do not have a direct equivalent within XFDF. These attributes are translated to XFDF as follows:
NotateXpress Annotation Attribute |
XFDF Annotation Attribute |
Translation / Modification |
ToolTipText |
Title |
|
ItemName |
Name |
|
Visible |
Flags |
The NotateXpress Visible annotation attribute is saved to the XFDF flags attribute as "noview". |
Locked | Flags | The NotateXpress Locked annotation attribute is saved to the XFDF flags attribute as "locked". |
PenWidth | Width | The NotateXpress penwidth attribute is twice that of the XFDF Width. Therefore, a NotateXpress PenWidth of 7 will be saved as an XFDF width of 3.5. |
Opacity | Opacity |
A NotateXpress annotation with an opacity of opaque will be converted to an XFDF annotation with an opacity of 1.0. A NotateXpress annotation with an opacity of transparent will be converted to an XFDF annotation with an opacity of 0.0. A NotateXpress annotation with an opacity of translucent will be converted to an XFDF annotation with an opacity of 5.0. |