Dear Jill,
Sorry for the delay.
We have released a hot-fix v2.0.6 of Spire.Pdf, in which we add new feature to support landscape pages and page numbers. Please download the upgrade from
http://www.e-iceblue.com/Download/downl ... t-now.html.
But if your pdf file includes landscape pages, you need to turn the landscape page during you convert it into a booklet as:
- Code: Select all
using System;
using Spire.Pdf;
namespace TestBooklet
{
class Program
{
static void Main(string[] args)
{
//Create a pdf document.
PdfDocument doc = new PdfDocument();
String srcPdf = @"..\..\4pagedoc.pdf";
float width = PdfPageSize.A4.Width * 2;
float height = PdfPageSize.A4.Height;
doc.CreateBooklet(srcPdf, width, height, true, delegate(object sender, DrawPageInBookletEventArgs e)
{
if (e.PageInSource.Size.Width > e.PageInSource.Size.Height)
{
//landscape
//save the current transformation matrix of the page canvas
e.PageInBooklet.Canvas.Save();
//affine transformation to turn page
e.PageInBooklet.Canvas.TranslateTransform(0, e.PageInSource.Size.Width);
float scaleX = e.PageInSource.Size.Height /PdfPageSize.A4.Height;
float scaleY = e.PageInSource.Size.Width / PdfPageSize.A4.Width;
e.PageInBooklet.Canvas.ScaleTransform(scaleX, scaleY);
e.PageInBooklet.Canvas.RotateTransform(-90);
}
},
delegate(object sender, DrawPageInBookletEventArgs e)
{
if (e.PageInSource.Size.Width > e.PageInSource.Size.Height)
{
//restor transformation matrix
e.PageInBooklet.Canvas.Restore();
}
});
//Save pdf file.
doc.SaveToFile("Booklet.pdf");
doc.Close();
System.Diagnostics.Process.Start("Booklet.pdf");
}
}
}
If you have any other question, please let us know.
Thanks and Regards,