View previous topic :: View next topic |
Author |
Message |
dsmeltz
Joined: 24 Jan 2008 Posts: 13
|
Posted: Wed May 21, 2008 2:51 pm Post subject: Incorrect page size for an odd size page |
|
|
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? |
|
Back to top |
|
|
AlbinoTux
Joined: 21 May 2008 Posts: 7
|
Posted: Wed May 21, 2008 4:03 pm Post subject: |
|
|
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)); |
|
|
Back to top |
|
|
dsmeltz
Joined: 24 Jan 2008 Posts: 13
|
Posted: Wed May 21, 2008 5:29 pm Post subject: |
|
|
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. |
|
Back to top |
|
|
AlbinoTux
Joined: 21 May 2008 Posts: 7
|
Posted: Wed May 21, 2008 5:49 pm Post subject: |
|
|
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() |
|
|
Back to top |
|
|
dsmeltz
Joined: 24 Jan 2008 Posts: 13
|
Posted: Wed May 21, 2008 6:03 pm Post subject: |
|
|
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. |
|
Back to top |
|
|
|