GdPicture.NET.14
GdPicture14 Namespace / AnnotationManager Class / SaveAnnotationsToXMPBase64Ex Method
Example





SaveAnnotationsToXMPBase64Ex Method (AnnotationManager)
Saves the GdPicture/XMP annotation part of all pages of the document currently handled by this AnnotationManager object to a Base64 encoded string.

Be aware that this method only handles GdPicture/XMP annotations.

Syntax
'Declaration
 
Public Function SaveAnnotationsToXMPBase64Ex() As String
 

Return Value

A Base64 encoded string containing the annotations data of all pages in the handled document.
Remarks

This method requires the Annotations component to run.

Example
How to transfer GdPicture/XMP annotations from one PDF document to another using a Base64 encoded string.
Dim annotationManager As AnnotationManager = New AnnotationManager()
If annotationManager.InitFromFile("source.pdf") = GdPictureStatus.OK Then
    Dim annotBase As String = annotationManager.SaveAnnotationsToXMPBase64Ex()
    If annotationManager.GetStat() = GdPictureStatus.OK Then
        annotationManager.Close()
        If (annotationManager.InitFromFile("dest.pdf") = GdPictureStatus.OK) AndAlso
           (annotationManager.LoadAnnotationsFromXMPBase64(annotBase) = GdPictureStatus.OK) Then
            If annotationManager.SaveDocumentToPDF("dest_updated.pdf") = GdPictureStatus.OK Then
                MessageBox.Show("Done!", "AnnotationManager.SaveAnnotationsToXMPBase64Ex")
            End If
            annotationManager.Close()
        Else
            MessageBox.Show("Error!   Status: " + annotationManager.GetStat().ToString(), "AnnotationManager.SaveAnnotationsToXMPBase64Ex")
        End If
    Else
        MessageBox.Show("Error!   Status: " + annotationManager.GetStat().ToString(), "AnnotationManager.SaveAnnotationsToXMPBase64Ex")
    End If
Else
    MessageBox.Show("Error!   Status: " + annotationManager.GetStat().ToString(), "AnnotationManager.SaveAnnotationsToXMPBase64Ex")
End If
annotationManager.Dispose()
See Also