mfenniak / pyPdf

Pure-Python PDF Library; this repository is no longer maintained, please see https://github.com/knowah/PyPDF2/ insead.
https://github.com/knowah/PyPDF2/
Other
276 stars 85 forks source link

Bug fix and improvement in RectangleObject getWidth() and getHeight() #40

Open etienned opened 12 years ago

etienned commented 12 years ago

In generic.py on line 727, it's like that:

def getHeight(self):
    return self.getUpperRight_y() - self.getLowerLeft_x()

And should be like that (the "x" change to "y" at the end):

def getHeight(self):
    return self.getUpperRight_y() - self.getLowerLeft_y()

Also both getWidth() and getHeight() output should be wrap in abs() like that:

def getHeight(self):
    return abs(self.getUpperRight_y() - self.getLowerLeft_y())

And we could add properties to make the thing more pleasant:

@property
def width(self):
    return self.getWidth()

@property
def height(self):
    return self.getHeight()