PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Fri Apr 26, 2024 5:17 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Wed May 21, 2008 2:51 pm 
Offline

Joined: Thu Jan 24, 2008 8:52 pm
Posts: 13
I'm trying to read a document that has a mix of page sizes. They are 8.5 x 11 and 7 x 9. The 7 x 9 pages report a Height and Width the same as those of the 8.5 x 11 pages. Is there some other property to check to get the actual page size or is this a problem with PDFSharp?


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed May 21, 2008 4:03 pm 
Offline

Joined: Wed May 21, 2008 3:59 pm
Posts: 7
Check that there is not a CropBox set, if there is, this can be used to remove it:

Code:
page.CropBox = new PdfRectangle(new XRect(0, 0, page.Width, page.Height));


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed May 21, 2008 5:29 pm 
Offline

Joined: Thu Jan 24, 2008 8:52 pm
Posts: 13
Removing the CropBox also discards the pages' original size. It did make it work, but I would like to maintain the pages original size. There must be some way to get the physical page size if the page doesn't conform to one of the predefined PageSize enums.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed May 21, 2008 5:49 pm 
Offline

Joined: Wed May 21, 2008 3:59 pm
Posts: 7
Changing the crop box does not discard the original page size, the page size is 8.5 x 11, but it was "cropped" to 7 x 9.

Are you asking if there is a way to obtain the cropped page size?

Code:
page.CropBox.Size.ToString()


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed May 21, 2008 6:03 pm 
Offline

Joined: Thu Jan 24, 2008 8:52 pm
Posts: 13
Now I'm not sure what I'm asking. :)

I'm appending 2 documents. The first has 8.5x11 pages, the second has 7x9 pages. I know I can get the cropped size (CropBox), but that doesn't have the 7x9 size in it. It appears to be a smaller rectangle than 7x9. The Page.Size property isn't the 7x9 size either, it has 8.5x11. So if there's a way to get the actual physical size of the page, that would be great.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 334 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group