[reportlab-users] Reportlab text not searchable in Apple OSX Preview.App? but searchable in Acrobat and google-pdf viewer ?

Robin Becker robin at reportlab.com
Wed Aug 5 08:21:03 EDT 2009


Bill Janssen wrote:

> hari jayaram <harijay at gmail.com> wrote:

>

>> I noticed however that the text laden pdfs I am rendering are not searchable

>> using Apple Mac (Leopard) OSX Preview.App

>>

>> When I use the built in search within Preview.App only single characters

>> light up ( only single characters show matches like a , b , c , d ) No words

>> light up..

>

> Works fine for me, generating PDFs with ReportLab 2.2 and searching with Preview.

>

> I add my text to the PDF a word at a time, with this code:

>

> textobj = mycanvas.beginText(word.left, word.baseline)

> textobj.setTextRenderMode(INVISIBLE_MODE)

> textstring = word.text.strip().encode('latin-1', 'replace')

> textobj.textLines(textstring)

> mycanvas.drawText(textobj)

>

> Incidentally, can I switch to UTF-8 these days?

>

> Bill

modern reportlab allows utf8 str or unicode in most places.
--
Robin Becker


More information about the reportlab-users mailing list