def __approximative_bounds(self): if len(self.chars) == 0: return self.rect size = self.font_size() approx = None for c in self.chars: if hasattr(c, "matrix") and c.matrix[0] == size: rect = pdftable.Rect(c.x0, c.y1, c.x1, c.y0) if approx == None: approx = rect elif approx.y1() == rect.y1(): approx = approx.union(rect) return approx
def __fix_bbox(self, bbox): return self.__fix_rect( pdftable.Rect(bbox[0], bbox[3], bbox[2], bbox[1]))
def __fix_rect(self, r): return pdftable.Rect(r.x1(), self.yBase - r.y1(), r.x2(), self.yBase - r.y2())