BurnAnnotationsToPage(Boolean,GdPictureOutputIntent) Method
In This Topic
Burn, in other words flatten, the GdPicture/XMP annotations into the selected page of the document currently handled by this AnnotationManager object.
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 doesn't support custom annotations burning.
Syntax
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.
- Intent
- A member of the GdPictureOutputIntent enumeration. Specifies the intent of the produced page after flattening.
The default value is GdPictureOutputIntent.IntentColor. Other intents produce smaller page size.
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.
Example
How to burn annotations to the currently selected page of the handled document.
Dim annotationManager As AnnotationManager = New AnnotationManager()
If (annotationManager.InitFromFile("image.jpg") = GdPictureStatus.OK) AndAlso
(annotationManager.PageCount > 0) AndAlso (annotationManager.SelectPage(1) = GdPictureStatus.OK) Then
Dim stamp As GdPicture14.Annotations.AnnotationRubberStamp = annotationManager.AddRubberStampAnnot(Color.Red, 0.5F, 0.5F, 2, 1, "APPROVED")
If stamp IsNot Nothing Then
stamp.Rotation = 20
If (annotationManager.SaveAnnotationsToPage() = GdPictureStatus.OK) AndAlso
(annotationManager.BurnAnnotationsToPage(True, GdPictureOutputIntent.IntentPalletized) = GdPictureStatus.OK) Then
If annotationManager.SaveDocumentToJPEG("image_approved.jpg", 75) = GdPictureStatus.OK Then
MessageBox.Show("Finished successfully!", "AnnotationManager.BurnAnnotationsToPage")
Else
MessageBox.Show("The file can't be saved. Status: " + annotationManager.GetStat().ToString(), "AnnotationManager.BurnAnnotationsToPage")
End If
Else
MessageBox.Show("Annotations can't be saved or burned. Status: " + annotationManager.GetStat().ToString(), "AnnotationManager.BurnAnnotationsToPage")
End If
stamp.Dispose()
Else
MessageBox.Show("The rubber stamp annotation can't be created. Status: " + annotationManager.GetStat().ToString(), "AnnotationManager.BurnAnnotationsToPage")
End If
annotationManager.Close()
Else
MessageBox.Show("The AnnotationManager can't be properly initialized. Status: " + annotationManager.GetStat().ToString(), "AnnotationManager.BurnAnnotationsToPage")
End If
annotationManager.Dispose()
AnnotationManager annotationManager = new AnnotationManager();
if ((annotationManager.InitFromFile("image.jpg") == GdPictureStatus.OK) &&
(annotationManager.PageCount > 0) && (annotationManager.SelectPage(1) == GdPictureStatus.OK))
{
GdPicture14.Annotations.AnnotationRubberStamp stamp = annotationManager.AddRubberStampAnnot(Color.Red, 0.5f, 0.5f, 2, 1, "APPROVED");
if (stamp != null)
{
stamp.Rotation = 20;
if ((annotationManager.SaveAnnotationsToPage() == GdPictureStatus.OK) &&
(annotationManager.BurnAnnotationsToPage(true, GdPictureOutputIntent.IntentPalletized) == GdPictureStatus.OK))
{
if (annotationManager.SaveDocumentToJPEG("image_approved.jpg", 75) == GdPictureStatus.OK)
MessageBox.Show("Finished successfully!", "AnnotationManager.BurnAnnotationsToPage");
else
MessageBox.Show("The file can't be saved. Status: " + annotationManager.GetStat().ToString(), "AnnotationManager.BurnAnnotationsToPage");
}
else
MessageBox.Show("Annotations can't be saved or burned. Status: " + annotationManager.GetStat().ToString(), "AnnotationManager.BurnAnnotationsToPage");
stamp.Dispose();
}
else
MessageBox.Show("The rubber stamp annotation can't be created. Status: " + annotationManager.GetStat().ToString(), "AnnotationManager.BurnAnnotationsToPage");
annotationManager.Close();
}
else
MessageBox.Show("The AnnotationManager can't be properly initialized. Status: " + annotationManager.GetStat().ToString(), "AnnotationManager.BurnAnnotationsToPage");
annotationManager.Dispose();
Example
How to burn annotations to the currently selected page of the handled document.
Dim annotationManager As AnnotationManager = New AnnotationManager()
If (annotationManager.InitFromFile("image.jpg") = GdPictureStatus.OK) AndAlso
(annotationManager.PageCount > 0) AndAlso (annotationManager.SelectPage(1) = GdPictureStatus.OK) Then
Dim stamp As GdPicture14.Annotations.AnnotationRubberStamp = annotationManager.AddRubberStampAnnot(Color.Red, 0.5F, 0.5F, 2, 1, "APPROVED")
If stamp IsNot Nothing Then
stamp.Rotation = 20
If (annotationManager.SaveAnnotationsToPage() = GdPictureStatus.OK) AndAlso
(annotationManager.BurnAnnotationsToPage(True, GdPictureOutputIntent.IntentPalletized) = GdPictureStatus.OK) Then
If annotationManager.SaveDocumentToJPEG("image_approved.jpg", 75) = GdPictureStatus.OK Then
MessageBox.Show("Finished successfully!", "AnnotationManager.BurnAnnotationsToPage")
Else
MessageBox.Show("The file can't be saved. Status: " + annotationManager.GetStat().ToString(), "AnnotationManager.BurnAnnotationsToPage")
End If
Else
MessageBox.Show("Annotations can't be saved or burned. Status: " + annotationManager.GetStat().ToString(), "AnnotationManager.BurnAnnotationsToPage")
End If
stamp.Dispose()
Else
MessageBox.Show("The rubber stamp annotation can't be created. Status: " + annotationManager.GetStat().ToString(), "AnnotationManager.BurnAnnotationsToPage")
End If
annotationManager.Close()
Else
MessageBox.Show("The AnnotationManager can't be properly initialized. Status: " + annotationManager.GetStat().ToString(), "AnnotationManager.BurnAnnotationsToPage")
End If
annotationManager.Dispose()
AnnotationManager annotationManager = new AnnotationManager();
if ((annotationManager.InitFromFile("image.jpg") == GdPictureStatus.OK) &&
(annotationManager.PageCount > 0) && (annotationManager.SelectPage(1) == GdPictureStatus.OK))
{
GdPicture14.Annotations.AnnotationRubberStamp stamp = annotationManager.AddRubberStampAnnot(Color.Red, 0.5f, 0.5f, 2, 1, "APPROVED");
if (stamp != null)
{
stamp.Rotation = 20;
if ((annotationManager.SaveAnnotationsToPage() == GdPictureStatus.OK) &&
(annotationManager.BurnAnnotationsToPage(true, GdPictureOutputIntent.IntentPalletized) == GdPictureStatus.OK))
{
if (annotationManager.SaveDocumentToJPEG("image_approved.jpg", 75) == GdPictureStatus.OK)
MessageBox.Show("Finished successfully!", "AnnotationManager.BurnAnnotationsToPage");
else
MessageBox.Show("The file can't be saved. Status: " + annotationManager.GetStat().ToString(), "AnnotationManager.BurnAnnotationsToPage");
}
else
MessageBox.Show("Annotations can't be saved or burned. Status: " + annotationManager.GetStat().ToString(), "AnnotationManager.BurnAnnotationsToPage");
stamp.Dispose();
}
else
MessageBox.Show("The rubber stamp annotation can't be created. Status: " + annotationManager.GetStat().ToString(), "AnnotationManager.BurnAnnotationsToPage");
annotationManager.Close();
}
else
MessageBox.Show("The AnnotationManager can't be properly initialized. Status: " + annotationManager.GetStat().ToString(), "AnnotationManager.BurnAnnotationsToPage");
annotationManager.Dispose();
See Also