[poppler] Copying text from PDF

Albert Astals Cid aacid at kde.org
Wed May 21 13:08:30 PDT 2008


A Dimecres 21 Maig 2008, Max Vasin va escriure:
> 	Hello!
>
> 	I write a PDF reader (which will hopefully evolve into something
> like Evince but without dependecies on GNOME libraries) using Qt4 and
> poppler-qt4.

You mean something like okular[1]? ;-)

> When I try to copy text from a page I get strage (to me) results. If
> Poppler::Page::text
> is called with a null QRectF it works fine, but if I pass it a non-null
> QRectF like this:
>
> 	Poppler::Page* page = doc->page(0);
> 	QRectF rect = QRectF(QPointF(0, 0), page->pageSizeF());
> 	QString str1 = page->text(rect);				// I get str1.size() == 0
> 	QString str2 = page->text(QRectF());				// I get str2.size() != 0
>
> it returns an empty string. What I'm doing wrong?

Seems a bug, i'm working on it.

Albert

>
> All libraries are from Debian testing:
> 	poppler-qt4 version 0.6.4
> 	qt4 version 4.4.0rc1

[1] http://www.okular.org


More information about the poppler mailing list