Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Links do not render in PDF. #42

Closed
migrome opened this issue Mar 13, 2013 · 11 comments
Closed

Links do not render in PDF. #42

migrome opened this issue Mar 13, 2013 · 11 comments

Comments

@migrome
Copy link

migrome commented Mar 13, 2013

from weasyprint import HTML
HTML(string='<a href="http://google.com">link</a>').write_pdf('tmp.pdf')

Makes non-clickable links in PDF

@SimonSapin
Copy link
Member

This is a bug. Root cause: weasyprint.urls.get_link_attribute() always returns if the document has not base URL, but it should allow absolute URLs.

@SimonSapin
Copy link
Member

Fixed, thanks.

@EugeneKovalev
Copy link

@SimonSapin the same thing appeared.

0.42.* works great but 44 (the last version at the moment) does not render clickable links in PDF

@Tontyna
Copy link
Contributor

Tontyna commented Jan 23, 2019

Clickable links require Cairo >= 1.15.4

@EugeneKovalev Any warnings logged? What's your Cairo version? What's your OS?

@SimonSapin
Copy link
Member

Sorry, I’m not actively working on WeasyPrint anymore. Consider filing a new bug with steps to reproduce, it’ll have more visibility.

@EugeneKovalev
Copy link

EugeneKovalev commented Jan 25, 2019

@Tontyna
OS - Ubuntu 18.10
Cairo - v1.14.8

Could you please tell me how to upgrade Cairo?
I have already tried to install the latest stable version. I ran ./configure, make, make install and it went to /usr/local/lib (seems to be OK)

But in python code when I run:

from cairocffi import cairo
print(cairo.cairo_version())

the output is 1.14.08


I also tried the solution from WeasyPrint docs:

sudo apt-get install build-essential python3-dev python3-pip python3-setuptools python3-wheel python3-cffi libcairo2 libpango-1.0-0 libpangocairo-1.0-0 libgdk-pixbuf2.0-0 libffi-dev shared-mime-info

Any thoughts?

@Tontyna
Copy link
Contributor

Tontyna commented Jan 25, 2019

Any thoughts?

Obviously the package repository isn't up-to-date. Since I dont know nothing about Ubuntu I have no idea how to get & install special versions of libraries.

@EugeneKovalev
Copy link

I succeeded to upgrade Cairo and now I can click links. I found out that all lib files are in /usr/lib/x86_64-linux-gnu

All I did to install Cairo 1.16.0 is:

rm /usr/lib/x86_64-linux-gnu/libcairo* &&
wget -c https://cairographics.org/releases/cairo-1.16.0.tar.xz &&
tar -xJf cairo-1.16.0.tar.xz && rm cairo-1.16.0.tar.xz

cd cairo-1.16.0/

./configure && make && make install &&
cp /usr/local/lib/libcairo* /usr/lib/x86_64-linux-gnu/

@Afoucaul
Copy link

Afoucaul commented May 6, 2019

@EugeneKovalev's solution fixed cairocffi, but it broke Pycairo for me. I had to remove the cairo directory in my install, and to re-install it.

@rjdebastiani
Copy link

Hey, @Afoucaul
Did you manage to fix cairocffi and have your links to work without breaking Pycairo?

@Afoucaul
Copy link

Hi @rjdebastiani, yeah I followed @EugeneKovalev's steps which fixed cairocffi, and then I uninstalled manually pycairo and re-installed it from pip.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants