Sunday, 15 June 2014

python - Reportlab, relative file link -



python - Reportlab, relative file link -

i trying create relative file link to, specifically, xlsx document in pdf using study lab. same question asked here relative file linking in pdf (reportlab), , unable comment.

edit: 1 person has answered, suggesting using file://, not relatively link however, goes root file directory when clicked. (at to the lowest degree in chrome , os x preview, required work in @ to the lowest degree chrome)

i posted same reply question: relative file linking in pdf (reportlab)

this how got relative links files work in reportlab:

from reportlab.pdfgen import canvas reportlab.lib.units import inch # create canvas , add together rectangle c = canvas.canvas("link_test.pdf") c.translate(inch, 9 * inch) c.rect(inch,inch,1*inch,1*inch, fill=1) # example.xlsx in same directory pdf c.linkurl(r'example.xlsx', (inch, inch, 2*inch, 2*inch), relative=1) c.save()

i'm using adobe reader 11.0.10.32. when click rectangle few warnings, file open after clicking "allow" , "yes".

python reportlab

No comments:

Post a Comment