Problem with Booklet example

Technical support for Spire.PDF

Moderator: iceblue support

Problem with Booklet example

Postby geekgirl » Wed Sep 28, 2011 12:44 pm

Hello,

I have just downloaded and installed an evaluation copy of your product. When i try to convert an existing pdf file with mixed portrait and landscape layout into a booklet (using your example booklet code but with the source file name changed) it does not copy the page numbers (i only see half a number 3 and no other numbers?) and it does not do the landscape pages as landscape.

Can you help me with this please?

Thank you
JC
geekgirl
 
Posts: 3
Joined: Wed Sep 28, 2011 11:35 am

Re: Problem with Booklet example

Postby harry.support » Fri Sep 30, 2011 7:11 am

Dear JC,

Sorry for the inconvenience cuased by us.
But we could not reproduce your problem, would you please send us your code and sample pdf files (post here or send mail to support@e-iceblue.com).
Next week, our office will enjoy the National Day Holiday. So we will respond you on 8, October, sorry for that.
Harry
Technical Support / Developer,
e-iceblue Support Team
User avatar
harry.support
 
Posts: 180
Joined: Mon Nov 08, 2010 3:11 pm

Re: Problem with Booklet example

Postby harry.support » Sun Oct 09, 2011 8:13 am

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,
Harry
Technical Support / Developer,
e-iceblue Support Team
User avatar
harry.support
 
Posts: 180
Joined: Mon Nov 08, 2010 3:11 pm

Re: Problem with Booklet example

Postby geekgirl » Tue Oct 11, 2011 1:24 pm

Thanks Harry ... that's excellent :-)
geekgirl
 
Posts: 3
Joined: Wed Sep 28, 2011 11:35 am

Re: Problem with Booklet example

Postby iceblue support » Thu Jun 28, 2012 3:49 am

Please feel free to contact us for anything at any time. Have a great day!
e-iceblue support
User avatar
iceblue support
 
Posts: 244
Joined: Tue Dec 21, 2010 2:56 am


Return to Spire.PDF

Who is online

Users browsing this forum: No registered users and 0 guests

cron