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 MergeOptions methods that could commonly be used:
- SetAll() - Used when you want the all the MergeOptions properties to propagate from the PDF document being merged or appended.
- SetAppend() - Typically used when appending PDF documents.
- SetNone() - Used when none of the PDF documents MergeOptions are wanted on the final PDF.
Note here that if no MergeOptions is specified in a MergeDocument constructor that the MergeOptions.All will be used. Alternatively if no MergeOptions is specified in the Append method that the MergeOptions.Append will be used.
This example shows how some of these static MergeOptions might typically be used:
[ASP - VBScript]
<!-- METADATA TYPE="typelib" UUID="{DF9225FE-94A4-490D-8CAD-E8366CE621D3}"-->
<%
Dim MyDocument
Dim MgOptions
Set MgOptions = Server.CreateObject( "DynamicPDF.MergeOptions" )
Set MyDocument = Server.CreateObject( "DynamicPDF.Document" )
MyDocument.LoadPdf Server.MapPath( "PDFs/fw9AcroForm_03.pdf" ), , ,MgOptions.SetAll()
MyDocument.AppendPdf Server.MapPath( "PDFs/fw9_03.pdf" ), , , MgOptions.SetAll()
MyDocument.DrawToWeb
Set MyDocument = Nothing
%>
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 it’s properties are set to true.
The following example displays how to create a MergeOptions object and define certain properties:
[ASP - VBScript]
<!-- METADATA TYPE="typelib" UUID="{DF9225FE-94A4-490D-8CAD-E8366CE621D3}"-->
<%
Dim MyDocument
Dim MgOptions
Set MgOptions = Server.CreateObject( "DynamicPDF.MergeOptions" )
MgOptions.MergeFormFields = True
MgOptions.Outlines = False
Set MyDocument = Server.CreateObject( "DynamicPDF.Document" )
MyDocument.LoadPdf Server.MapPath( "PDFs/fw9AcroForm_03.pdf" ), , ,MgOptions
MyDocument.AppendPdf Server.MapPath( "PDFs/fw9_03.pdf" ), , , MgOptions
MyDocument.DrawToWeb
Set MyDocument = Nothing
%>
| See Also |

