Annotations in a NotateXpress™ XML file or memory are loaded using the same methods as those used for loading .nxp annotation data from file or memory:
Retrieve Annotations from NotateXpress XML File
LoadOptions can be used, if desired, to provide specific instructions for loading the annotations.
- Set the AnnType to NotateXpressXml, to indicate that NotateXpress XML annotations are being retrieved.
- Set LoadUserData to indicate whether or not unknown (user specified) attributes should be read when loading the NotateXpress xml.
Call the FromFile method to load the NotateXpress XML file into the NotateXpress layer collection. If the NotateXpress xml file is a multi-page file, set the PageNumber property to specify from which page annotations should be loaded. Attempting to load a page that does not exist will cause a PageNotFoundException.
Retrieve Annotations from NotateXpress XML via Byte Array
LoadOptions can be used, if desired, to provide specific instructions for loading the annotations.
- Set the AnnType to NotateXpressXml, to indicate that NotateXpress xml annotations are being retrieved.
- Set LoadUserData to indicate whether or not unknown (user specified) attributes should be read when loading the NotateXpress xml.
- Call FromByteArray to save annotations from a byte array to a specified layer, or
- Call FromMemoryStream to retrieve annotations from a memory stream.
Retrieve Password Protected Layers
Annotations loaded from a NotateXpress XML file may be password protected by layer. When annotations are loaded from a file or variant, the LayerRestored event is raised. Additionally, if the layer was saved with a password, the RequestLayerPassword event is raised. This provides a trigger for the application to provide the password, or display a dialog to the end user requesting the password. If the correct password is supplied during the RequestLayerPassword event, the layer is decrypted and loaded into NotateXpress.