[reportlab-users] Adding annotations to a pdf

Robin Becker robin at reportlab.com
Mon Dec 10 03:36:02 EST 2018


Hi pianoslum,

I suspect there may be something amiss with your code as we have a test of highlightAnnotation in the reportlab source code tests see

https://bitbucket.org/rptlab/reportlab/src/default/tests/test_pdfgen_links.py#


I have just run this with Python2.7 and tested that the annotations work using both acrobat reader and evince (running in ubuntu 
16.04).


Perhaps you could post the actual code that your are testing with (or a cut down example) and some details of the envirnment eg 
python version, os etc etc.

-- 
Robin Becker

On 09/12/2018 22:37, pianoslum wrote:
> Dear all,
> 
> using reportlab in python, I manged to print a text and export this to a new pdf:
> canvas.drawString(10, 100, "Hello world")
> 
> However, I didn't manage to add an annotation. I tried
> 
> canvas.highlightAnnotation("TEST", Rect=[1, 1, 1, 1], relative=1)
> 
> which didn't raise an error, however evince cannot parse the resulting pdf file.
> Am I doing something wrong? The docu of the related functions is very sparse, so I would appreciate any help.
> 
> Cheers!
> 
........


More information about the reportlab-users mailing list