3

Possible Duplicate:
Why my code not correctly split every page in a scanned pdf?

I am using pyPdf to split pdf pages. Everything works ok, but page sizes are not the same.

Original page size: 1000px

p1.mediaBox.upperRight = (w/2, h)  # get 500px
p2.mediaBox.upperLeft  = (w/2, h)  # get 1000px

I checked page size with the command: (w, h) = p.mediaBox.upperRight. Why is upperLeft wrong?

Community
  • 1
  • 1
lolalola
  • 3,773
  • 20
  • 60
  • 96
  • We need to know what all of the other boundaries of `p1` and `p2` are, and how you have set `h` and `w`, before we can confidently answer your question. – Brandon Rhodes Nov 24 '11 at 21:00
  • Just two thoughts, are you sure you're cropping the pages as you should? UpperRight (for the left page is correct since |---->) I would suggest you do the same for the right page, mesure it from left to right and if that doesn't work do it any way but add the size of the p1 when you crop the second page so: p1.mediaBox.upperRight = (w/2, h) p2.mediaBox.upperRight = (w/2, h) Or you do: p1.mediaBox.upperRight = (w/2, h) p2.mediaBox.upperRight = (w/2 - p1Width, h) Or you switch library because then pyPdf is just not logical. – Torxed Jan 17 '12 at 08:46

0 Answers0