1
1
mirror of https://github.com/Kozea/WeasyPrint.git synced 2024-10-05 08:27:22 +03:00
Commit Graph

156 Commits

Author SHA1 Message Date
Guillaume Ayoub
840c4a6d92 Don't crash when using UTC timezones
Fix #862.
2019-05-14 15:32:17 +02:00
Guillaume Ayoub
1d0c3e435f Use explicit variable names 2019-04-02 11:37:16 +02:00
Guillaume Ayoub
84e1813c6c Merge branch 'master' into media-queries 2019-04-01 14:41:51 +02:00
Guillaume Ayoub
b7a9fe7dcc Update copyright 2019-03-04 11:04:06 +01:00
Guillaume Ayoub
bdd45475b6 Clean a lot of things in API documentation 2019-02-22 11:34:46 +01:00
Guillaume Ayoub
03f01e37ee Update and add some docstrings 2019-02-21 17:34:56 +01:00
Guillaume Ayoub
857d889816 Merge branch 'master' into media-queries 2019-01-24 18:36:53 +01:00
Guillaume Ayoub
b81a669c74 Escape links and targets with quotes
Fix #774.
2019-01-23 16:05:01 +01:00
Guillaume Ayoub
3513e95b41 Use a separate logger for generation progress 2019-01-03 23:02:44 +01:00
Guillaume Ayoub
3ac9c67a79 Add comments about rounding floats to avoid locale problems 2018-12-29 17:11:30 +01:00
Guillaume Ayoub
cb87108ecf Use integers instead of floats for links and bookmarks
Fix #742.
2018-12-29 14:19:59 +01:00
Guillaume Ayoub
ddf10d2d71 Avoid deprecated function 2018-11-22 17:00:53 +01:00
Guillaume Ayoub
c34b1285ba Localize floats used by Cairo tags
According to the documentation (and to the code), Cairo seems to rely on
locale-dependent strings for tag attributes. It's for sure a bad idea, but at
least try to follow this rule and see if it fixes our problems.

Related to #742.
2018-11-22 14:07:40 +01:00
Guillaume Ayoub
dfab8a8225 Use named destinations instead of pages and position for links
There's a limitation / bug in cairo: we can't add links to pages that have not
been created yet. We have to use named destinations instead as they work even
if the destination has not been created.

This change offers the advantage of advertising targets: generated PDF files
now embed the list of named targets (even if I don't know if PDF readers have a
UI for that feature).

Fix #678.
2018-09-24 15:27:24 +02:00
Guillaume Ayoub
56904baa79 Use the same copyright line everywhere 2018-09-20 18:46:27 +02:00
Guillaume Ayoub
4a6153fa7d Put media queries in a separate module, create a class for style_for 2018-08-17 10:30:51 +02:00
Guillaume Ayoub
b29c68568f Merge branch 'cairopdf' of github.com:Kozea/WeasyPrint into cairopdf 2018-08-13 15:12:04 +02:00
Guillaume Ayoub
0ca72bb64e Avoid useless nested function call 2018-08-08 17:47:47 +02:00
Guillaume Ayoub
a55a391f66 Rename misleading function name write_pdf_attachments 2018-08-08 14:41:03 +02:00
Guillaume Ayoub
9401466a7a Fix Python 3.4 compatibility 2018-08-06 19:18:17 +02:00
Guillaume Ayoub
0834615b78 Don't use pdfrw anymore
pdfrw is a great piece of software, but we don't know PDF enough to debug the
problems we've met. It's safer to use the new cairo API and get back to manual
edition for attachments and bleed boxes.

We only have two regressions for now:
- some internal links are broken,
- PDF producer is not overwritten.

A mail has been sent to cairo's mailing-list about that:
https://lists.cairographics.org/archives/cairo/2018-August/028694.html

Fix #639, #615, fix #596, fix #565.
2018-08-06 17:38:02 +02:00
Guillaume Ayoub
f57cbf3a7e Merge branch 'master' into target-collector 2018-04-30 22:59:09 +02:00
Guillaume Ayoub
91d10f0608 Clean Cairo warning
I don't know why only the first line of the message is displayed by
warnings.warn.
2018-04-19 01:17:52 +02:00
Guillaume Ayoub
d2a6833555 Always include token type when dealing with URLs 2018-04-16 13:20:52 +02:00
Guillaume Ayoub
d37060399b Lint 2018-04-13 11:00:13 +02:00
Guillaume Ayoub
f6bd84e4ab Warn users with cairo < 1.15.4
Related to #339, #565, #616.
2018-04-13 10:44:19 +02:00
Guillaume Ayoub
07865f6371 Don't use a global target collector 2018-03-28 00:34:34 +02:00
Guillaume Ayoub
1ebd36e83a Merge branch 'target-counter' of https://github.com/Tontyna/WeasyPrint into target-collector 2018-03-25 22:03:19 +02:00
Guillaume Ayoub
34e29926b5 Use font config in stylesheets given in CLI
Related to #596.
2018-03-23 23:57:33 +01:00
Tontyna
f66c8d095f Merge branch 'master' into target-counter 2018-03-14 00:56:31 +01:00
Guillaume Ayoub
5341031162 Merge branch 'master' into flexbox 2018-02-19 14:32:19 +01:00
Tontyna
4519ba5bee introduce TARGET_COLLECTOR for target-counter, -counters and -text 2018-02-11 22:42:26 +01:00
Guillaume Ayoub
6f4aefae51 Fix typo in docstring 2018-01-28 19:33:24 +01:00
Guillaume Ayoub
cdd175cd58 Keep a reference to font_config in Document
Fix #566.
2018-01-28 15:45:39 +01:00
Guillaume Ayoub
16e8186568 Drop Python 2 support 2018-01-14 01:48:17 +01:00
Guillaume Ayoub
724565f27a Don't allow attribute access to StyleDict objects 2018-01-13 17:05:23 +01:00
Guillaume Ayoub
921f7cd527 Fix circular imports 2018-01-07 01:46:39 +01:00
Guillaume Ayoub
0fcf4134ca Merge pull request #516 from Kozea/pdfrw
Use pdfrw instead of editing PDF files directly
2017-10-05 11:18:12 +02:00
Guillaume Ayoub
e5dcab7cf3 Cleanups 2017-10-05 08:45:50 +02:00
Guillaume Ayoub
f5367c8559 Use __del__ instead of explicit clean to clean font configurations
This avoids rendering problems when the @font-face font files were removed
before calling write_pdf, write_image_surface or write_png.
2017-10-04 14:29:38 +02:00
Guillaume Ayoub
0c27e94468 Add a font_config parameter to various render methods
Fix #506.
2017-10-01 15:17:32 +02:00
Václav Pokluda
05446f5eff Added support to work with bleed like padding (bleed-top/right/bottom/left) 2017-09-21 12:03:09 +02:00
Guillaume Ayoub
5ce24fd959 Fix bleedbox translation for multiple pages 2017-09-05 20:22:24 +02:00
Guillaume Ayoub
71d54095bd Add support of marks and bleed pages properties
Fix #471.
2017-09-05 15:44:50 +02:00
Guillaume Ayoub
84dd9b8002 Merge branch 'master' into namedpages 2017-08-02 23:52:17 +02:00
Guillaume Ayoub
fcd6bf7070 Clean and document the logging levels
Related to #488.
2017-07-25 13:59:56 +02:00
Guillaume Ayoub
f856edb3b4 Log the document generation steps
Related to #488.
2017-07-25 13:58:18 +02:00
Guillaume Ayoub
344cb08f60 Don't copy styles when copying boxes, improve memory management
Style is not copied anymore when boxes are duplicated. Style dicts are not
modified anymore during the layout, as it was before for some properties:

- margins, borders and paddings when the box was split between two
  pages (useless as these computed values are stored directly in the box),
- top borders were changed in tables (useless for the same reason),
- bookmark labels and string sets are now stored in the box.

This commit can introduce very subtle bugs that are hard to debug. In the
future, we should try to freeze the style dicts before the layout.

Related to #70.
2017-07-22 13:51:03 +02:00
Guillaume Ayoub
c004dc47d1 Use a custom object instead of constants for page pseudo-classes
This is a first step to lazily get the page styles and support named pages.
2017-07-17 22:48:21 +02:00
Guillaume Ayoub
ba26fa34a9 Use ElementTree's elements as much as possible 2017-07-03 15:19:05 +02:00