|
Rank: Newbie Groups: Member
Joined: 8/9/2012 Posts: 6
|
I have an existing PDF document that has a page size of 8.5in X 11in (US Letter Size). When I do a Pages.Add(), all of the pages that are appended programmatically have a page size of 8.26in X 11.69in (A4 page size). My guess is this is due to the default settings on my workstation (I am based in Europe).
My question is: how do I add pages that have the same size as existing pages?
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,195
|
Hi, Pages.Add will return you a PdfPage object. You can then set that object's Size property to change the page size. It will be something like this:
Code: C#
//Add a new page
PdfPage page = doc.Pages.Add();
//Set the page size, here width and height are in inches
page.Size = new PdfSize(width, height);
Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 8/9/2012 Posts: 6
|
That did the trick for me, thank you.
|
|