Xamarin.Forms

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class PdfMergeOptions

    Show / Hide Table of Contents

    Class PdfMergeOptions

    Represents to customize the support of merging PDF documents.

    Inheritance
    System.Object
    PdfMergeOptions
    Namespace: Syncfusion.Pdf
    Assembly: Syncfusion.Pdf.Portable.dll
    Syntax
    public class PdfMergeOptions : Object
    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")

    See Also

    PdfDocument
    PdfMergeOptions
    Back to top Generated by DocFX
    Copyright © 2001 - 2023 Syncfusion Inc. All Rights Reserved