This KB article will introduce and show you how to use the BurnedFileImageSource example class. The BurnedFileImageSource takes a path to your document and a LayerCollection then returns to you images with those annotations rendered on to them. It's very useful for burning annotations while saving a document as it is an ImageSource and can be directly passed in to both the PdfEncoder and TiffEncoder.
string documentPath = @"Path to your document";
string annotationsPath = @"Path to your annotations";
string newDocumentPath = @"Path to your newly saved document";
//You can get the LayerCollection a number of ways, but the AnnotationController is the simplest.
using(AnnotationController ac = new AnnotationController())
//Load the annotations.
//Pass the document path and annotation layers
using (BurnedFileImageSource burnedImages = new BurnedFileImageSource(documentPath, ac.Layers))
//You can swap out the PdfEncoder for the TiffEncoder without changing anything else.
MultiFramedImageEncoder encoder = new PdfEncoder();
using(Stream newDocumentStream =
File.Open(newDocumentPath, FileMode.Create, FileAccess.ReadWrite, FileShare.Read))
Dim documentPath As String = "Path to your document"
Dim annotationsPath As String = "Path to your annotations"
Dim newDocumentPath As String = "Path to your newly saved document"