VintaSoft Imaging .NET SDK 14.1: Документация для .NET разработчика
Vintasoft.Imaging.Codecs.Decoders Namespace / PdfRenderingSettings Class / DrawPdfAnnotations Property
Синтаксис Ремарки Example Требования Смотрите также
В этом разделе
    DrawPdfAnnotations Свойство (PdfRenderingSettings)
    В этом разделе
    Возвращает или задает значение, указывающее, должна ли страница PDF отображаться с аннотациями, отличными от Vintasoft.
    Синтаксис
    '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; }
    
    
    [Description("A value indicating whether PDF page should be rendered with non Vintasoft annotations.")]
    [DefaultValue(True)]
    public: __property bool get_DrawPdfAnnotations();
    public: __property void set_DrawPdfAnnotations(
    bool value
    );
    [Description("A value indicating whether PDF page should be rendered with non Vintasoft annotations.")]
    [DefaultValue(True)]
    public:
    property bool DrawPdfAnnotations { bool get(); void set(bool value); }

    Property Value

    Значение по умолчанию - true.
    Ремарки

    Вам следует установить для значений этого свойства и свойства DrawVintasoftAnnotations значение true, если вы хотите отображать страницу со всеми аннотациями. .

    Пример

    Вот пример, показывающий, как отображать PDF страницу с аннотациями:

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

    Требования

    Целевые платформы: .NET 9; .NET 8; .NET 7; .NET 6; .NET Framework 4.8, 4.7, 4.6, 4.5, 4.0, 3.5

    Смотрите также