GdPicture.NET.14
GdPicture14 Namespace / GdViewer Class / SaveAnnotationsToPage() Method
Example





In This Topic
SaveAnnotationsToPage() Method
In This Topic
Forces the GdViewer control to save GdPicture/XMP annotations to the current page defined by the CurrentPage property, of the document displayed in the GdViewer control. Be aware that annotations are always treated relative to the currently displayed page.

This method only attaches rendered annotations to the current page while keeping them in the GdPicture/XMP format. You need to use the BurnAnnotationsToPage(Boolean) method to permanently include them into the page content.

This method is applied internally automatically on each page change.

Syntax
'Declaration
 
Public Function SaveAnnotationsToPage() As GdPictureStatus
public GdPictureStatus SaveAnnotationsToPage()
public function SaveAnnotationsToPage(): GdPictureStatus; 
public function SaveAnnotationsToPage() : GdPictureStatus;
public: GdPictureStatus SaveAnnotationsToPage(); 
public:
GdPictureStatus SaveAnnotationsToPage(); 

Return Value

A member of the GdPictureStatus enumeration. If the method has been successfully followed, then the return value is GdPictureStatus.OK. We strongly recommend always checking this status first.
Remarks
Be aware that this method is applied internally always when you change the page, for example using the DisplayPage method and others.

Just to inform you that saving annotations keeps them in the GdPicture/XMP format alongside with the document. Please use the BurnAnnotationsToPage(Boolean) method if you want to permanently incorporate the annotations to be part of the document content.

The method only handles GdPicture/XMP annotations as well.

Example
How to save annotations to the currently displayed page in the viewer.
'We assume that the GdViewer1 control has been properly integrated.
If GdViewer1.DisplayFromFile("") = GdPictureStatus.OK Then
    'Annotate your document.
    If GdViewer1.SaveAnnotationsToPage() <> GdPictureStatus.OK Then
        MessageBox.Show("Annotations can't be saved. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.SaveAnnotationsToPage")
    End If
Else
    MessageBox.Show("The file can't be loaded. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.SaveAnnotationsToPage")
End If
//We assume that the GdViewer1 control has been properly integrated.
if (GdViewer1.DisplayFromFile("") == GdPictureStatus.OK)
{
    //Annotate your document.
    if (GdViewer1.SaveAnnotationsToPage() != GdPictureStatus.OK)
        MessageBox.Show("Annotations can't be saved. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.SaveAnnotationsToPage");
}
else
    MessageBox.Show("The file can't be loaded. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.SaveAnnotationsToPage");
See Also