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

Set absolute path for hyperlinks #437

Closed
l0o0 opened this Issue Mar 6, 2017 · 3 comments

Comments

Projects
None yet
2 participants
@l0o0

l0o0 commented Mar 6, 2017

Is there any way to set absolute path for hyperlinks for weasyprint?
I try to use HTML(string='<a href="html/images/poisson_chs.png">This is a link</a>', base_url='.').write_pdf('tmp.pdf'), but the pdf is automatically changed to a absolute path. Even I set base_url in weasyprint.HTML.
Is it any way to keep the relative path in the html code?

@liZe liZe closed this in 1215cb5 Mar 25, 2017

@liZe liZe added this to the v0.37 milestone Mar 25, 2017

@liZe

This comment has been minimized.

Show comment
Hide comment
@liZe

liZe Mar 25, 2017

Member

Thanks for the good idea! It's now possible, without base_url (base_url is being transformed to an absolute path, it's a useful feature).

Member

liZe commented Mar 25, 2017

Thanks for the good idea! It's now possible, without base_url (base_url is being transformed to an absolute path, it's a useful feature).

@liZe liZe added the feature label Mar 25, 2017

@l0o0

This comment has been minimized.

Show comment
Hide comment
@l0o0

l0o0 Apr 1, 2017

Is possible in the new version of weasyprint? I thinks it's quite useful for setting absolute path in the pdf when I copy the folder with pictures or other resources to another's machine.

l0o0 commented Apr 1, 2017

Is possible in the new version of weasyprint? I thinks it's quite useful for setting absolute path in the pdf when I copy the folder with pictures or other resources to another's machine.

@liZe

This comment has been minimized.

Show comment
Hide comment
@liZe

liZe Apr 1, 2017

Member

Is possible in the new version of weasyprint?

Yes, it is (with the current git version).

Member

liZe commented Apr 1, 2017

Is possible in the new version of weasyprint?

Yes, it is (with the current git version).

netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this issue Aug 1, 2017

kleink
Update py-weasyprint to 0.39.
Version 0.39
------------

Released on 2017-06-24.

Bug fixes:

* Fix the use of WeasyPrint's URL fetcher with CairoSVG.


Version 0.38
------------

Released on 2017-06-16.

Bug fixes:

* `#477 <https://github.com/Kozea/WeasyPrint/issues/477>`_:
  Don't crash on font-face's src attributes with local functions.


Version 0.37
------------

Released on 2017-06-15.

WeasyPrint now depends on tinycss2 instead of tinycss.

New features:

* `#437 <https://github.com/Kozea/WeasyPrint/issues/437>`_:
  Support local links in generated PDFs.

Bug fixes:

* `#412 <https://github.com/Kozea/WeasyPrint/issues/412>`_:
  Use a NullHandler log handler when WeasyPrint is used as a library.
* `#417 <https://github.com/Kozea/WeasyPrint/issues/417>`_,
  `#472 <https://github.com/Kozea/WeasyPrint/issues/472>`_:
  Don't crash on some line breaks.
* `#327 <https://github.com/Kozea/WeasyPrint/issues/327>`_:
  Don't crash with replaced elements with height set in percentages.
* `#467 <https://github.com/Kozea/WeasyPrint/issues/467>`_:
  Remove incorrect line breaks.
* `#446 <https://github.com/Kozea/WeasyPrint/pull/446>`_:
  Let the logging module do the string interpolation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment