[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 11:13:26 EDT 2009

hari jayaram wrote:

> I also tried the test code :import reportlab.pdfgen.canvas as canvas

> c = canvas.Canvas("searchtext.pdf")

> c.rotate(90)

> textobj = c.beginText(10,-10)

> textstring = "Dispense File Prefix: %s" % "hello world"

> textobj.textLines(textstring)

> c.drawText(textobj)

> c.rotate(-90)

> c.showPage()

> c.save()

based on this example and the non-searchability of the rotated version I would
guess the problem lies in the preview app.

If you just substitutute 0 for 90 & -90 in the above then essentially the same
code as for the failing case is issued. Does the preview still fail?

If the preview is actually rendering the pdf and then searching, the 0 degrees
case should be searchable. If that's the way the search is happening then it's
no surprise that the search should fail if the rendered letters are at 90deg.
Robin Becker

More information about the reportlab-users mailing list