VintaSoft Imaging .NET SDK 15.1: Documentation for .NET developer
Vintasoft.Imaging.Codecs.Decoders Namespace / PdfRenderingSettings Class / DrawPdfAnnotations Property
Syntax Remarks Example Requirements SeeAlso
In This Topic
DrawPdfAnnotations Property (PdfRenderingSettings)
In This Topic
Gets or sets a value indicating whether PDF page should be rendered with non Vintasoft annotations.
Syntax
'Declaration

<DescriptionAttribute("A value indicating whether PDF page should be rendered with non Vintasoft annotations.")>
<DefaultValueAttribute(True)>
Public Property DrawPdfAnnotations As Boolean

[Description("A value indicating whether PDF page should be rendered with non Vintasoft annotations.")]
[DefaultValue(True)]
public bool DrawPdfAnnotations { get; set; }

Property Value

Default value is true.
Remarks

You should set values of this property and DrawVintasoftAnnotations property to true if you want to render page with all annotations.

Example

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;
}

Requirements

Target Platforms: .NET 10; .NET 9; .NET 8; .NET 7; .NET 6; .NET Framework 4.8, 4.7, 4.6, 4.5, 4.0, 3.5

See Also