[reportlab-users] How to highlight text in PDF file

Dang Quang Vinh dqvinh87 at gmail.com
Mon Jun 23 13:24:53 EDT 2014


Hello

 

Thank you very much

 

Could you give me a hint how to find a text inside a PDF file, after that I
can calculate the corresponding highlight rectangle?

 

 

 

From: reportlab-users [mailto:reportlab-users-bounces at lists2.reportlab.com]
On Behalf Of Tim Roberts
Sent: Monday, June 23, 2014 19:23
To: reportlab-users
Subject: Re: [reportlab-users] How to highlight text in PDF file

 

Dang Quang Vinh wrote:

Dear all,

 

With ReportLab, how can I highlight a text like the following image:


You do it by hand.  You compute the height and width of the string (which
you can do with stringWidth and the font size or leading), then draw a
yellow rectangle, of that size, then draw the text on top of it.





I think it is a basic feature of PDF reader application nowadays.


That's true.  I do hope you understand that ReportLab is not a PDF reader,
nor is it used for creating PDF reader applications.  It is used to create
PDF files.



-- 
Tim Roberts, timr at probo.com <mailto:timr at probo.com> 
Providenza & Boekelheide, Inc.


---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://two.pairlist.net/pipermail/reportlab-users/attachments/20140623/955642dc/attachment.html>


More information about the reportlab-users mailing list