MergeOptions
Represents options for merging PDF documents.
public class MergeOptions
Public Class MergeOptions
Inheritance: ObjectMergeOptions
Licensing Info
This class is a DynamicPDF Core Suite Essentials feature. One of the following is required for non-evaluation usage:
- Any active DynamicPDF Subscription (Essentials, Professional, Professional Plus or Ultimate).
- A DynamicPDF Core Suite for .NET v12.X Essentials license.
- It can also be used for free with a public link back to www.dynamicpdf.com and with the DynamicPDF Essentials message displaying on the bottom of each page.
Examples
The following example shows how to enter text in a text field specifying the MergeOptions.Imports System
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.Forms
Imports ceTe.DynamicPDF.Merger
Module MyModule
Sub Main()
' Create a MergeOptions object to import the AcroForm
Dim options As MergeOptions = New MergeOptions(True)
' Create a merge document with your PDF containing form fields
Dim MyDocument As MergeDocument = New MergeDocument("C:\ImportPDF.pdf", options)
' Set the value of the text field equal to the string you want to appear
Dim text As TextField = MyDocument.Form.Fields("Text3")
text.Value = "This is my text field"
' Save the PDF
MyDocument.Draw("C:\MyDocument.pdf")
End Sub
End Module
using System;
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.Merger;
using ceTe.DynamicPDF.Forms;
public class Example
{
public static void CreatePDF(string outputPath, string inputFilePath)
{
// Create a MergeOptions object to import the AcroForm
MergeOptions options = new MergeOptions(true);
// Create a merge document with your PDF containing form fields
MergeDocument document = new MergeDocument(inputFilePath, options);
// Set the value of the text field equal to the string you want to appear
TextField text = (TextField)document.Form.Fields["Text3"];
text.Value = "This is my text field";
// Save the PDF
document.Draw(outputPath);
}
}
Remarks
Currently the only merge option is whether or not to preserve the form fields on the PDF being merged in. Specifying true will keep the form fields on the merged PDF where specifying false will remove the form fields from the PDF.
Constructors
MergeOptions() | Initializes a new instance of the MergeOptions class. |
MergeOptions(Boolean) | Initializes a new instance of the MergeOptions class. |
MergeOptions(Boolean, String) | Initializes a new instance of the MergeOptions class. |
Properties
All | Gets a MergeOptions object with all options set to true. |
AllOtherData | Gets or sets a value indicating if all other document data should be imported. |
Append | Gets a MergeOptions object that you would typically use when appending documents. |
DocumentInfo | Gets or sets a value indicating if document information should be imported. |
DocumentJavaScript | Gets or sets a value indicating if document level JavaScript should be imported. |
DocumentProperties | Gets or sets a value indicating if document properties should be imported. |
EmbeddedFiles | Gets or sets a value indicating if the Embedded files should be imported. |
FormFieldJavaScript | Gets or sets the Form field level JavaScript. |
FormFields | Gets or sets a value indicating if form fields should be imported. |
FormsXfaData | Gets or sets a value indicating if form XFA data should be imported. |
LogicalStructure | Gets or Sets the value indicating if logical structure should be imported. |
None | Gets a MergeOptions object with all options set to false. |
OpenAction | Gets or sets a value indicating if the documents opening action (initial page and zoom settings) should be imported. |
OptionalContentInfo | Gets or sets the Output Content should be imported. |
Outlines | Gets or sets a value indicating if outlines and bookmarks should be imported. |
OutputIntent | Gets or Sets a value indication if OutputIntent should be imported. |
PageAnnotations | Gets or sets a value indicating if annotations should be imported. |
PageJavaScript | Gets or sets the Page level JavaScript. |
PageLabelsAndSections | Gets or sets a value indicating if page labels and sections should be imported. |
RootFormField | Gets or sets the root form field for imported form fields. |
RootOutline | Gets or sets the root outline for imported outlines. |
XmpMetadata | Gets or sets a value indicating if Xmp Metadata should be imported. |
Methods
Equals(Object) | Determines whether the specified Object is equal to the current Object . (Inherited from Object) |
GetHashCode() | Serves as a hash function for a particular type. (Inherited from Object) |
GetType() | Gets the Type of the current instance. (Inherited from Object) |
ToString() | Returns a String that represents the current Object . (Inherited from Object) |