FlattenAnnotations Property (PdfDocumentCompressorCommand)
Gets or sets a value indicating whether the command must flatten (burn) annotations.
Property Value
True - command must flatten annotations; false - command must NOT flatten annotations.
Default value is false.
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);
}
Target Platforms: .NET9; .NET 8; .NET 7; .NET 6; .NET Framework 4.8, 4.7, 4.6, 4.5, 4.0, 3.5