Class PdfMergeOptions
Represents to customize the support of merging PDF documents.
Inheritance
System.Object
PdfMergeOptions
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Syncfusion.Pdf
Assembly: Syncfusion.Pdf.Base.dll
Syntax
public class PdfMergeOptions
Examples
// Destination PDF document
PdfDocument destDoc = new PdfDocument();
// Source PDF documents
string[] source = { "Src1.pdf", "Src2.pdf" };
PdfMergeOptions option = new PdfMergeOptions();
option.OptimizeResources = true;
//Merge the source pdf document.
PdfDocumentBase.Merge(destDoc, option, source);
destDoc.Save("Merge.pdf");
' Destination PDF document
Dim destDoc As PdfDocument = New PdfDocument()
' Source PDF documents
Dim source() As String = { "Src1.pdf", "Src2.pdf" }
'Merge the source pdf document.
Dim [option] As PdfMergeOptions = New PdfMergeOptions()
[option].OptimizeResources = True
PdfDocumentBase.Merge(destDoc, [option], source)
destDoc.Save("Merge.pdf")
Constructors
PdfMergeOptions()
Declaration
public PdfMergeOptions()
Properties
ExtendMargin
When ExtendMargin is set to true, then specified margin is considered while importing the pages from the existing document.
Declaration
public bool ExtendMargin { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Examples
// Destination PDF document
PdfDocument destDoc = new PdfDocument();
PdfMargins margin = new PdfMargins();
//Set left margin.
margin.Left = 20;
//Set right margin.
margin.Right = 40;
//Set top margin.
margin.Top = 100;
//Set bottom margin.
margin.Bottom = 100;
//Set margin.
destDoc.PageSettings.Margins = margin;
// Source PDF documents
string[] source = { "Src1.pdf", "Src2.pdf" };
PdfMergeOptions option = new PdfMergeOptions();
option.ExtendMargin = true;
//Merge the source pdf document.
PdfDocumentBase.Merge(destDoc, option, source);
destDoc.Save("Merge.pdf");
' Destination PDF document
Dim destDoc As PdfDocument = New PdfDocument()
Dim margin As New PdfMargins()
'Set left margin.
margin.Left = 20
'Set right margin.
margin.Right = 40
'Set top margin.
margin.Top = 100
'Set bottom margin.
margin.Bottom = 100
'Set margin.
destDoc.PageSettings.Margins = margin
' Source PDF documents
Dim source() As String = { "Src1.pdf", "Src2.pdf" }
'Merge the source pdf document.
Dim [option] As PdfMergeOptions = New PdfMergeOptions()
[option].ExtendMargin = True
PdfDocumentBase.Merge(destDoc, [option], source)
destDoc.Save("Merge.pdf")
OptimizeResources
Gets or sets to optimize resources while merging PDF documents.
Declaration
public bool OptimizeResources { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Examples
// Destination PDF document
PdfDocument destDoc = new PdfDocument();
// Source PDF documents
string[] source = { "Src1.pdf", "Src2.pdf" };
PdfMergeOptions option = new PdfMergeOptions();
option.OptimizeResources = true;
//Merge the source pdf document.
PdfDocumentBase.Merge(destDoc, option, source);
destDoc.Save("Merge.pdf");
' Destination PDF document
Dim destDoc As PdfDocument = New PdfDocument()
' Source PDF documents
Dim source() As String = { "Src1.pdf", "Src2.pdf" }
'Merge the source pdf document.
Dim [option] As PdfMergeOptions = New PdfMergeOptions()
[option].OptimizeResources = True
PdfDocumentBase.Merge(destDoc, [option], source)
destDoc.Save("Merge.pdf")