Skip to content

Commit

Permalink
Bugfix for non-rotated pages.
Browse files Browse the repository at this point in the history
  • Loading branch information
felixc committed Dec 15, 2009
1 parent 9624504 commit 6c9a048
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions pdfslice.py
Expand Up @@ -106,11 +106,12 @@ def crop(page, page_num, options):
""" Apply user-specified bounds to the page. """
# Note that (page_num % 2 == 0) is the correct test for odd numbered pages,
# since we are using 0-indexed ones, where the user expects 1-indexed.
if "oddbounds" in options and (page_num % 2 == 0):
bounds = options["oddbounds"]
else:
bounds = options["bounds"]
page.mediaBox = pyPdf.generic.RectangleObject(bounds)
if page is not None:
if "oddbounds" in options and (page_num % 2 == 0):
bounds = options["oddbounds"]
else:
bounds = options["bounds"]
page.mediaBox = pyPdf.generic.RectangleObject(bounds)


def rotate(page, page2, options):
Expand Down

0 comments on commit 6c9a048

Please sign in to comment.