Closed zeina99 closed 4 years ago
Hi @zeina99, I think the problem is this: Your crop bounding-box (0, 0, 0.5*float(page.width), 0)
— has a height of 0. To get the left half, you'll instead want: (0, 0, 0.5*float(page.width), page.height)
.
As of my knowledge, the coordinates required are (x and y from top left, x and y from bottom right)
Almost, but not quite. The coordinates required are:
x0
: left-x of bounding box, measured from left side of pagetop
: top-y of bounding box, measured from top of pagex1
: right-x of bounding box, measured from left side of pagebottom
: bottom-y of bounding box, measured from top of pageThanks, this clears it up!
What are you trying to do?
I am trying to crop a page to get the left half and the right half separately.
What code are you using to do it?
Paste it here, or attach a Python file.
PDF file
Pdf file: language-models.pdf
Expected behavior
What did you expect the result should have been?
I expected it to crop the page to only the left half. As of my knowledge, the coordinates required are (x and y from top left, x and y from bottom right)
Actual behavior
I got an error saying the area is zero.
Screenshots
The page I was trying to crop:
Environment
Additional context