- Demo
- C# source
- VB.Net source
The sample demonstrates how to convert a PDF document to a booklet.
using System; using Spire.Pdf; namespace Booklet { class Program { static void Main(string[] args) { //Create a pdf document. PdfDocument doc = new PdfDocument(); String srcPdf = @"Sample2.pdf"; float width = PdfPageSize.A4.Width * 2; float height = PdfPageSize.A4.Height; doc.CreateBooklet(srcPdf, width, height, true); //Save pdf file. doc.SaveToFile("Booklet.pdf"); doc.Close(); //Launching the Pdf file. System.Diagnostics.Process.Start("Booklet.pdf"); } } }
Imports Spire.Pdf Namespace Booklet Friend Class Program Shared Sub Main(ByVal args() As String) 'Create a pdf document. Dim doc As New PdfDocument() Dim srcPdf As String = "Sample2.pdf" Dim width As Single = PdfPageSize.A4.Width * 2 Dim height As Single = PdfPageSize.A4.Height doc.CreateBooklet(srcPdf, width, height, True) 'Save pdf file. doc.SaveToFile("Booklet.pdf") doc.Close() 'Launching the Pdf file. Process.Start("Booklet.pdf") End Sub End Class End Namespace