Xamarin.Forms

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

    Show / Hide Table of Contents

    Class PdfBookletCreator

    Represents a booklet creator, which allows to create a booklet from a PDF document.

    Inheritance
    System.Object
    PdfBookletCreator
    Namespace: Syncfusion.Pdf
    Assembly: Syncfusion.Pdf.Portable.dll
    Syntax
    public sealed class PdfBookletCreator : Object
    Examples
    //Load a PDF document.
    PdfLoadedDocument ldoc = new PdfLoadedDocument("SourceDoc.pdf");
    //Creates a booklet from the given PDF document.         
    PdfDocument doc = PdfBookletCreator.CreateBooklet(ldoc, new SizeF(300, 500));
    //Save the document.
    doc.Save("Booklet.pdf");
    //Close the document.
    doc.Close(true);
    'Load a PDF document.
    Dim ldoc As PdfLoadedDocument = New PdfLoadedDocument("SourceDoc.pdf")
    'Creates a booklet from the given PDF document.              
    Dim doc As PdfDocument = PdfBookletCreator.CreateBooklet(ldoc, New SizeF(300, 500))
    'Save the document.
    doc.Save("Booklet.pdf")
    'Close the document.
    doc.Close(True);

    Methods

    CreateBooklet(PdfLoadedDocument, SizeF)

    Initializes a new instance of the PdfBookletCreator class with PdfLoadedDocument and page size.

    Declaration
    public static PdfDocument CreateBooklet(PdfLoadedDocument loadedDocument, SizeF pageSize)
    Parameters
    Type Name Description
    PdfLoadedDocument loadedDocument

    The existing PDF document.

    SizeF pageSize

    Size of the page.

    Returns
    Type Description
    PdfDocument

    The initialized PDF document, which could be saved.

    Examples
    //Load a PDF document.
    PdfLoadedDocument ldoc = new PdfLoadedDocument("SourceDoc.pdf");
    // Creates a booklet from the given PDF document.         
    PdfDocument doc = PdfBookletCreator.CreateBooklet(ldoc, new SizeF(300, 500));
    //Save the document.
    doc.Save("Booklet.pdf");
    //Close the documents.
    doc.Close(true);
    ldoc.Close(true);
    'Load a PDF document.
    Dim ldoc As PdfLoadedDocument = New PdfLoadedDocument("SourceDoc.pdf")
    'Creates a booklet from the given PDF document.              
    Dim doc As PdfDocument = PdfBookletCreator.CreateBooklet(ldoc, New SizeF(300, 500))
    'Save the document.
    doc.Save("Booklet.pdf")
    'Close the documents.
    doc.Close(True)
    ldoc.Close(True)
    See Also
    PdfDocument
    PdfLoadedDocument

    CreateBooklet(PdfLoadedDocument, SizeF, Boolean)

    Initializes a new instance of the PdfBookletCreator class PdfLoadedDocument, page size and flag to set two side print.

    Declaration
    public static PdfDocument CreateBooklet(PdfLoadedDocument loadedDocument, SizeF pageSize, bool twoSide)
    Parameters
    Type Name Description
    PdfLoadedDocument loadedDocument

    The PdfLoadedDocument.

    SizeF pageSize

    Size of the page.

    System.Boolean twoSide

    if set to true if the result in document should be printed on both sides of paper.

    Returns
    Type Description
    PdfDocument

    The initialized PDF document, which could be saved.

    Examples
    //Load a PDF document.
    PdfLoadedDocument ldoc = new PdfLoadedDocument("SourceDoc.pdf");
    //Creates a booklet from the given PDF document.  
    PdfDocument doc = PdfBookletCreator.CreateBooklet(ldoc, new SizeF(300, 500), false);
    //Save the document.
    doc.Save("Booklet.pdf");
    //Close the documents.
    doc.Close(true);
    ldoc.Close(true);
    'Load a PDF document.
    Dim ldoc As PdfLoadedDocument = New PdfLoadedDocument("SourceDoc.pdf")
    'Creates a booklet from the given PDF document.             
    Dim doc As PdfDocument = PdfBookletCreator.CreateBooklet(ldoc, New SizeF(300, 500), False)
    'Save the document.
    doc.Save("Booklet.pdf")
    'Close the document.
    doc.Close(True)
    ldoc.Close(True)
    See Also
    PdfDocument
    PdfLoadedDocument

    CreateBooklet(PdfLoadedDocument, SizeF, Boolean, PdfMargins)

    Initializes a new instance of the PdfBookletCreator class.

    Declaration
    public static PdfDocument CreateBooklet(PdfLoadedDocument loadedDocument, SizeF pageSize, bool twoSide, PdfMargins margin)
    Parameters
    Type Name Description
    PdfLoadedDocument loadedDocument

    The PdfLoadedDocument

    SizeF pageSize

    Size of the page.

    System.Boolean twoSide

    if set to true if the result in document should be printed on both sides of paper.

    PdfMargins margin

    The margin value for generated PDF document.

    Returns
    Type Description
    PdfDocument

    The initialized PDF document, which could be saved.

    Examples
    //Loads an existing document.
    PdfLoadedDocument srcDoc = new PdfLoadedDocument("sourceDoc.pdf");
    //Specify the margin.
    PdfMargins margin = new PdfMargins();
    margin.All = 10;
    //Creates a booklet from the given PDF document.        
    PdfDocument doc = PdfBookletCreator.CreateBooklet(srcDoc,new SizeF(300, 500), false,margin);
    //Save the document.
    doc.Save("Booklet.pdf");
    //Close the documents.
    doc.Close(true);
    srcDoc.Close(true);
    'Loads an existing document.
    Dim srcDoc As PdfLoadedDocument = New PdfLoadedDocument("sourceDoc.pdf")
    'Specify the margin.
    Dim margin As PdfMargins = New PdfMargins()
    margin.All = 10
    'Creates a booklet from the given PDF document.         
    Dim doc As PdfDocument = PdfBookletCreator.CreateBooklet(srcDoc,New SizeF(300, 500), False,margin)
    'Save the document
    doc.Save("Booklet.pdf")
    'Close the documents.
    doc.Close(True)
    srcDoc.Close(True)
    See Also
    PdfDocument
    PdfLoadedDocument

    See Also

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