[poppler] About my getText patch
Kristian Høgsberg
krh at bitplanet.net
Wed Apr 20 10:14:55 PDT 2005
Albert Astals Cid wrote:
> I have realised it has either a bad comment or bad
> code, because the comment on Poppler::Rectangle says
> the coordinates have to be on PDF system but then they
> are not handled like that, it should have a
>
> y1 = height - rect->y2;
> y2 = height - rect->y1;
Yeah, we have that conversion in the glib bindings a couple of places
because the xpdf is internally inconsistent. The text output device and
all functionality based on it use coordinates with (0,0) being the upper
left corner (screen coordinates). In the glib wrapper we wanted to
present a consistent coordinate system, so we need to convert those
coordinates to normal PDF coordinates.
I think it's kind of arbitrary which coordinate system you choose, and
if you want to present consistent coordiates in the wrapper, you need to
convert in one place or the other anyway. Given that the PDF standard
specifies a system with (0,0) in the lower left corner I think it makes
sense to stick with that, though.
cheers,
Kristian
More information about the poppler
mailing list