DrawPdfAnnotations Property (PdfRenderingSettings)
Gets or sets a value indicating whether PDF page should be rendered with non Vintasoft annotations.
You should set values of this property and DrawVintasoftAnnotations property to true if you want to render page with all annotations.
Here is an example that shows how to render a PDF page with annotations:
''' <summary>
''' Renders PDF page with the PDF annotations.
''' </summary>
''' <param name="page">The page of PDF document.</param>
Public Shared Function RenderPdfPageWithPdfAnnotations(page As Vintasoft.Imaging.Pdf.Tree.PdfPage) As Vintasoft.Imaging.VintasoftImage
' get rendering settings of PDF page
Dim renderingSettings As Vintasoft.Imaging.Codecs.Decoders.PdfRenderingSettings = page.Document.RenderingSettings
' save previous value of PdfRenderingSettings.DrawPdfAnnotations property
Dim prevDrawPdfAnnotations As Boolean = renderingSettings.DrawPdfAnnotations
' enable rendering of PDF annotations on PDF page
renderingSettings.DrawPdfAnnotations = True
' render PDF page
Dim image As Vintasoft.Imaging.VintasoftImage = page.Render()
' restore value of PdfRenderingSettings.DrawPdfAnnotations property
renderingSettings.DrawPdfAnnotations = prevDrawPdfAnnotations
' return the image of PDF page
Return image
End Function
/// <summary>
/// Renders PDF page with the PDF annotations.
/// </summary>
/// <param name="page">The page of PDF document.</param>
public static Vintasoft.Imaging.VintasoftImage RenderPdfPageWithPdfAnnotations(
Vintasoft.Imaging.Pdf.Tree.PdfPage page)
{
// get rendering settings of PDF page
Vintasoft.Imaging.Codecs.Decoders.PdfRenderingSettings renderingSettings = page.Document.RenderingSettings;
// save previous value of PdfRenderingSettings.DrawPdfAnnotations property
bool prevDrawPdfAnnotations = renderingSettings.DrawPdfAnnotations;
// enable rendering of PDF annotations on PDF page
renderingSettings.DrawPdfAnnotations = true;
// render PDF page
Vintasoft.Imaging.VintasoftImage image = page.Render();
// restore value of PdfRenderingSettings.DrawPdfAnnotations property
renderingSettings.DrawPdfAnnotations = prevDrawPdfAnnotations;
// return the image of PDF page
return image;
}
Target Platforms: .NET9; .NET 8; .NET 7; .NET 6; .NET Framework 4.8, 4.7, 4.6, 4.5, 4.0, 3.5