Back to Devexpress

PdfDocumentProcessor.FlattenForm() Method

officefileapi-devexpress-dot-pdf-dot-pdfdocumentprocessor-72cd72d3.md

latest2.9 KB
Original Source

PdfDocumentProcessor.FlattenForm() Method

Flattens an entire interactive form.

Namespace : DevExpress.Pdf

Assembly : DevExpress.Docs.v25.2.dll

NuGet Package : DevExpress.Document.Processor

Declaration

csharp
public bool FlattenForm()
vb
Public Function FlattenForm As Boolean

Returns

TypeDescription
Boolean

true If the interactive form is flattened successfully; false If the document doesn’t contain an interactive form that should be flattened.

|

Remarks

You can call the FlattenForm method the following way:

csharp
using (PdfDocumentProcessor processor = new PdfDocumentProcessor()) {
     processor.LoadDocument("Demo.pdf");
     if (processor.FlattenForm())
          processor.SaveDocument("Result.pdf");
}
vb
Using processor As New PdfDocumentProcessor()
    processor.LoadDocument("Demo.pdf")
    If processor.FlattenForm() Then
        processor.SaveDocument("Result.pdf")
    End If
End Using

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the FlattenForm() method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

pdf-document-api-flatten-interactive-form/CS/FlattenInteractiveForm/Program.cs#L24

csharp
// Flatten a whole interactive form.
if (processor.FlattenForm())

pdf-document-api-flatten-interactive-form/VB/FlattenInteractiveForm/Program.vb#L22

vb
' Flatten a whole interactive form.
If processor.FlattenForm() Then
    ' Save a document with the flattened form.

See Also

PdfDocumentProcessor Class

PdfDocumentProcessor Members

DevExpress.Pdf Namespace