'We assume that the GdViewer1 control has been properly integrated
'and your document has been properly displayed as well.
'Assuming you have already annotated the displayed document.
Dim annotStream As System.IO.MemoryStream = New System.IO.MemoryStream()
If GdViewer1.SaveAnnotationsToXMPEx(annotStream) = GdPictureStatus.OK Then
GdViewer1.CloseDocument()
If (GdViewer1.DisplayFromFile("test.pdf") = GdPictureStatus.OK) AndAlso
(GdViewer1.LoadAnnotationsFromXMP(annotStream) = GdPictureStatus.OK) Then
GdViewer1.Redraw()
If GdViewer1.SaveDocumentToPDF("test_annotated.pdf") = GdPictureStatus.OK Then
MessageBox.Show("Done!", "GdViewer.LoadAnnotationsFromXMP")
Else
MessageBox.Show("Error! : " + GdViewer1.GetStat().ToString(), "GdViewer.LoadAnnotationsFromXMP")
End If
Else
MessageBox.Show("Error! : " + GdViewer1.GetStat().ToString(), "GdViewer.LoadAnnotationsFromXMP")
End If
End If
annotStream.Dispose()
//We assume that the GdViewer1 control has been properly integrated
//and your document has been properly displayed as well.
//Assuming you have already annotated the displayed document.
System.IO.MemoryStream annotStream = new System.IO.MemoryStream();
if (GdViewer1.SaveAnnotationsToXMPEx(annotStream) == GdPictureStatus.OK)
{
GdViewer1.CloseDocument();
if ((GdViewer1.DisplayFromFile("test.pdf") == GdPictureStatus.OK) &&
(GdViewer1.LoadAnnotationsFromXMP(annotStream) == GdPictureStatus.OK))
{
GdViewer1.Redraw();
if (GdViewer1.SaveDocumentToPDF("test_annotated.pdf") == GdPictureStatus.OK)
MessageBox.Show("Done!", "GdViewer.LoadAnnotationsFromXMP");
else
MessageBox.Show("Error! : " + GdViewer1.GetStat().ToString(), "GdViewer.LoadAnnotationsFromXMP");
}
else
{
MessageBox.Show("Error! : " + GdViewer1.GetStat().ToString(), "GdViewer.LoadAnnotationsFromXMP");
}
}
annotStream.Dispose();