Class PdfBookletCreator
Represents a booklet creator, which allows to create a booklet from a PDF document.
Inheritance
Namespace: Syncfusion.Pdf
Assembly: Syncfusion.Pdf.Base.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. |
System.Drawing.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
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. |
System.Drawing.SizeF | pageSize | Size of the page. |
System.Boolean | twoSide | if set to |
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
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 | |
System.Drawing.SizeF | pageSize | Size of the page. |
System.Boolean | twoSide | if set to |
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
CreateBooklet(String, String, SizeF)
Initializes a new instance of the PdfBookletCreator class with source PDF path,destination file name and page size.
Declaration
public static void CreateBooklet(string from, string into, SizeF pageSize)
Parameters
Type | Name | Description |
---|---|---|
System.String | from | The path to the file on the disk, which the booklet should be created from. |
System.String | into | The path to the file on the disk, which the booklet should be saved into. |
System.Drawing.SizeF | pageSize | Size of the page. |
Remarks
This method is not supported in WinRT, Windows Phone, Xamarin, Universal Windows Platform and Silverlight
Examples
//Creates a booklet from the given PDF document.
PdfDocument doc = PdfBookletCreator.CreateBooklet("SourceDocument.pdf","Booklet.pdf",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 document.
doc.Close(True)
ldoc.Close(True)
See Also
CreateBooklet(String, String, SizeF, Boolean)
Initializes a new instance of the PdfBookletCreator class with source path,destination,page size and flag to set two side print.
Declaration
public static void CreateBooklet(string from, string into, SizeF pageSize, bool twoSide)
Parameters
Type | Name | Description |
---|---|---|
System.String | from | The path to the file on the disk, which the booklet should be created from. |
System.String | into | The path to the file on the disk, which the booklet should be saved into. |
System.Drawing.SizeF | pageSize | Size of the page. |
System.Boolean | twoSide | if set to |
Remarks
This method is not supported in WinRT, Windows Phone, Xamarin, Universal Windows Platform and Silverlight
Examples
//Load a PDF document.
PdfLoadedDocument ldoc = new PdfLoadedDocument("SourceDoc.pdf");
//Create booklet with two sides.
PdfDocument doc = PdfBookletCreator.CreateBooklet("SourceDocument.pdf","Booklet.pdf",new SizeF(300, 500), true);
'Load a PDF document.
Dim ldoc As PdfLoadedDocument = New PdfLoadedDocument("SourceDoc.pdf")
'Create booklet with two sides.
Dim doc As PdfDocument = PdfBookletCreator.CreateBooklet("SourceDocument.pdf","Booklet.pdf",New SizeF(300, 500), true)
'Save the document.
doc.Save("Booklet.pdf")
'Close the documents.
doc.Close(True)
ldoc.Close(True)