Form Flattening in a PDF (.NET Core/Framework)
Form Flattening in a PDF using DynamicPDF Core Suite is straightforward.
How to Accomplish Form Flattening in C#
The following steps and sample code illustrate Form Flattening in a PDF using DynamicPDF Core Suite.
Steps for Form Flattening in a PDF
- Create a
MergeDocument
object with the desired PDF. - Set the output property to
Flatten
. - Save the PDF document.
Sample Code - C#
MergeDocument document = new MergeDocument( "output.pdf" );
document.Form.Output = FormOutput.Flatten;
document.Draw( "output.pdf" );
How to Accomplish Field Level Flattening in C#
The following steps and sample code illustrates how to use Field Level Flattening in a PDF using DynamicPDF Core Suite.
Steps for Field Level Flattening in PDF
- Create a
MergeDocument
object with the desired PDF. - Set the output property to
Flatten
for the desired field. - Save the PDF document.
Sample Code - C#
MergeDocument document = new MergeDocument( "output.pdf" );
document.Form.Fields[0].Output = FormFieldOoutput.Flatten;
document.Draw( "output.pdf" );
GitHub Project
Clone or view the example project at GitHub. This example code is contained in the Examples/FormFlatteningExample.cs file.
Getting Started
NuGet Package
DynamicPDF Core Suite is available on NuGet and is part of the ceTe.DynamicPDF.CoreSuite.NET
package. The easiest way to install the package is by using the Visual Studio Package Manager. But you can also download the package directly from NuGet.
DynamicPDF Core Suite Information
More information can be found on the DynamicPDF Core Suite website.
Available on Other Platforms
DynamicPDF Core Suite is also available for the Java and COM/ActiveX platforms. Refer to the respective product pages for more details.
- Java - DynamicPDF Merger for Java
- COM/ActiveX - DynamicPDF Merger for COM/ActiveX