GdPicture.NET.14
GdPicture14 Namespace / GdViewer Class / BurnAnnotationsToPage Method / BurnAnnotationsToPage(Boolean) Method
Set this parameter to true, if you want to remove the initial annotation blob content from the file, otherwise set it to false.
Example





In This Topic
BurnAnnotationsToPage(Boolean) Method
In This Topic
Burn, in other words flatten, the GdPicture/XMP annotations into the current page of the document displayed in the GdViewer control.

Burning (flattening) annotations means simply including them directly into the content of the page, to which they belong, so they are not more editable. This will permanently write an annotation into the document, so it is not considered as an annotation anymore.

This method uses vector graphics when drawing annotations (except for custom annotations).

Syntax
'Declaration
 
Public Overloads Function BurnAnnotationsToPage( _
   ByVal RemoveInitialAnnots As Boolean _
) As GdPictureStatus
public GdPictureStatus BurnAnnotationsToPage( 
   bool RemoveInitialAnnots
)
public function BurnAnnotationsToPage( 
    RemoveInitialAnnots: Boolean
): GdPictureStatus; 
public function BurnAnnotationsToPage( 
   RemoveInitialAnnots : boolean
) : GdPictureStatus;
public: GdPictureStatus BurnAnnotationsToPage( 
   bool RemoveInitialAnnots
) 
public:
GdPictureStatus BurnAnnotationsToPage( 
   bool RemoveInitialAnnots
) 

Parameters

RemoveInitialAnnots
Set this parameter to true, if you want to remove the initial annotation blob content from the file, otherwise set it to false.

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
Please note that annotations are always treated relative to the currently displayed page.

Be aware that you need to use the BurnAnnotationsToPage(Boolean,Boolean) method to burn (rasterize) your custom annotations.

Example
How to burn annotations to the current page and to all pages in your document.
This example shows you how to burn annotations to the current page.
'We assume that the GdViewer1 control has been properly integrated.
If GdViewer1.DisplayFromFile("") = GdPictureStatus.OK Then
    'Annotate your document.
    If GdViewer1.BurnAnnotationsToPage(True) = GdPictureStatus.OK Then
        If GdViewer1.SaveDocumentToPDF("mydocument.pdf") = GdPictureStatus.OK Then
            MessageBox.Show("Done!", "GdViewer.BurnAnnotationsToPage")
        Else
            MessageBox.Show("The file can't be saved. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.BurnAnnotationsToPage")
        End If
    Else
        MessageBox.Show("Annotations can't be burned. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.BurnAnnotationsToPage")
    End If
Else
    MessageBox.Show("The file can't be loaded. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.BurnAnnotationsToPage")
End If
//We assume that the GdViewer1 control has been properly integrated.
if (GdViewer1.DisplayFromFile("") == GdPictureStatus.OK)
{
    //Annotate your document.
    if (GdViewer1.BurnAnnotationsToPage(true) == GdPictureStatus.OK)
    {
        if (GdViewer1.SaveDocumentToPDF("mydocument.pdf") == GdPictureStatus.OK)
            MessageBox.Show("Done!", "GdViewer.BurnAnnotationsToPage");
        else
            MessageBox.Show("The file can't be saved. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.BurnAnnotationsToPage");
    }
    else
        MessageBox.Show("Annotations can't be burned. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.BurnAnnotationsToPage");
}
else
    MessageBox.Show("The file can't be loaded. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.BurnAnnotationsToPage");
This example shows you how to burn annotations to all pages in your document.
'We assume that the GdViewer1 control has been properly integrated
'and your document has been properly displayed as well.
            
'Annotate your document.
Dim oAnnotationManager As AnnotationManager = GdViewer1.GetAnnotationManager()
Dim pageCount As Integer = oAnnotationManager.PageCount
Dim status As GdPictureStatus = GdPictureStatus.OK
For i As Integer = 1 To pageCount
    status = oAnnotationManager.SelectPage(i)
    If status = GdPictureStatus.OK Then
        status = oAnnotationManager.BurnAnnotationsToPage(True)
        If status <> GdPictureStatus.OK Then Exit For
    Else
        Exit For
    End If
Next
oAnnotationManager.Close()
If status <> GdPictureStatus.OK Then
    MessageBox.Show("Annotations can't be burned. Status: " + status.ToString(), "GdViewer.BurnAnnotationsToPage")
End If
//We assume that the GdViewer1 control has been properly integrated
//and your document has been properly displayed as well.
//Annotate your document.
AnnotationManager oAnnotationManager = GdViewer1.GetAnnotationManager();
int pageCount = oAnnotationManager.PageCount;
GdPictureStatus status = GdPictureStatus.OK;
for (int i = 1; i <= pageCount; i++)
{
    status = oAnnotationManager.SelectPage(i);
    if (status == GdPictureStatus.OK)
    {
        status = oAnnotationManager.BurnAnnotationsToPage(true);
        if (status != GdPictureStatus.OK) break;
    }
    else
        break;
}
oAnnotationManager.Close();
if (status != GdPictureStatus.OK)
    MessageBox.Show("Annotations can't be burned. Status: " + status.ToString(), "GdViewer.BurnAnnotationsToPage");
See Also