Welcome Guest Search | Active Topics | Sign In | Register

Page Size when adding pages to existing PDF Document Options
Silviu
Posted: Thursday, August 9, 2012 5:09:20 AM
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?
eo_support
Posted: Thursday, August 9, 2012 9:23:24 AM
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!
Silviu
Posted: Thursday, August 9, 2012 9:36:02 AM
Rank: Newbie
Groups: Member

Joined: 8/9/2012
Posts: 6
That did the trick for me, thank you.


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.