VintaSoft Imaging .NET SDK 14.0: Documentation for .NET developer
Vintasoft.Imaging.Pdf.Processing Namespace / PdfDocumentCompressorCommand Class / FlattenAnnotations Property
Syntax Example Requirements SeeAlso
In This Topic
    FlattenAnnotations Property (PdfDocumentCompressorCommand)
    In This Topic
    Gets or sets a value indicating whether the command must flatten (burn) annotations.
    Syntax
    'Declaration
    
    <CategoryAttribute("Discard")>
    <DescriptionAttribute("A value indicating whether the command must flatten annotations.")>
    <DefaultValueAttribute(False)>
    Public Property FlattenAnnotations As Boolean
    
    
    [Category("Discard")]
    [Description("A value indicating whether the command must flatten annotations.")]
    [DefaultValue(False)]
    public bool FlattenAnnotations { get; set; }
    
    
    [Category("Discard")]
    [Description("A value indicating whether the command must flatten annotations.")]
    [DefaultValue(False)]
    public: __property bool get_FlattenAnnotations();
    public: __property void set_FlattenAnnotations(
    bool value
    );
    [Category("Discard")]
    [Description("A value indicating whether the command must flatten annotations.")]
    [DefaultValue(False)]
    public:
    property bool FlattenAnnotations { bool get(); void set(bool value); }

    Property Value

    True - command must flatten annotations; false - command must NOT flatten annotations.
    Default value is false.
    Example

    Here is an example that shows how to flatten annotations and remove interactive form of the PDF document:

    
    ''' <summary>
    ''' Flatten an annotations and remove intractive form of the PDF document.
    ''' </summary>
    ''' <param name="inPdfFilename">The input PDF filename.</param>
    ''' <param name="outPdfFilename">The output PDF filename.</param>
    Public Shared Sub FlattenAnnotations(inPdfFilename As String, outPdfFilename As String)
        ' create compressor with empty compression settings
        Dim compressor As Vintasoft.Imaging.Pdf.Processing.PdfDocumentCompressorCommand = Vintasoft.Imaging.Pdf.Processing.PdfDocumentCompressorCommand.CreateEmptyCompressor()
    
        ' specify that compressor must remove interactive form from PDF document
        compressor.RemoveInteractiveForm = True
        ' specify that compressor must flatten annotations in PDF document
        compressor.FlattenAnnotations = True
    
        ' compress PDF document
        compressor.Compress(inPdfFilename, outPdfFilename)
    End Sub
    
    
    
    /// <summary>
    /// Flatten an annotations and remove intractive form of the PDF document.
    /// </summary>
    /// <param name="inPdfFilename">The input PDF filename.</param>
    /// <param name="outPdfFilename">The output PDF filename.</param>
    public static void FlattenAnnotations(string inPdfFilename, string outPdfFilename)
    {
        // create compressor with empty compression settings
        Vintasoft.Imaging.Pdf.Processing.PdfDocumentCompressorCommand compressor =
           Vintasoft.Imaging.Pdf.Processing.PdfDocumentCompressorCommand.CreateEmptyCompressor();
    
        // specify that compressor must remove interactive form from PDF document
        compressor.RemoveInteractiveForm = true;
        // specify that compressor must flatten annotations in PDF document
        compressor.FlattenAnnotations = true;
    
        // compress PDF document
        compressor.Compress(inPdfFilename, outPdfFilename);
    }
    
    

    Requirements

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

    See Also