Merge Options

There are many flexible options when merging or appending a document using our MergeOptions object. MergeOptions is used to specify exactly what information you would like preserved from the PDF file that you are merging or appending.

Using the Static MergeOptions

Because there are a few common cases in which a user would typically need certain MergeOptions set, we have defined three static MergeOptions that could commonly be used:

NOTE: If MergeOptions is not specified in a MergeDocument constructor, then the MergeOptions.All will be used. Alternatively if MergeOptions is not specified in the Append method then the MergeOptions.Append will be used.

This example shows how some of these static MergeOptions might typically be used:

MergeDocument document = new MergeDocument( pdfFilePath, MergeOptions.All );
document.Append( pdfFilePath, MergeOptions.Append );
document.Draw(pdfFilePath);        
Dim MyDocument As MergeDocument = New MergeDocument( pdfFilePath, MergeOptions.All )
MyDocument.Append( pdfFilePath, MergeOptions.Append )
MyDocument.Draw(pdfFilePath)   

Defining Custom MergeOptions

A MergeOptions object can also be instantiated and defined giving you complete control over the different parts of the document that will or will not be merged into the final PDF. When a MergeOptions object is instantiated, by default all its properties are set to true.

The following example displays how to create a MergeOptions object and define certain properties:

MergeOptions options = new MergeOptions( false );
options.PageAnnotations = false;
options.Outlines = false;
options.DocumentInfo = false;
MergeDocument document = new MergeDocument( pdfFilePath, MergeOptions.All );
document.Append( pdfFilePath, options );
document.Draw(pdfFilePath);       
Dim options As MergeOptions = New MergeOptions( False )
options.PageAnnotations = False
options.Outlines = False
options.DocumentInfo = False
Dim MyDocument As MergeDocument = New MergeDocument( pdfFilePath, MergeOptions.All )
MyDocument.Append( pdfFilePath, options )
MyDocument.Draw(pdfFilePath)

In this topic