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

81 Commits

Author SHA1 Message Date
Guillaume Ayoub
b40ad461be Remove repeated copyright assignments in files
Everything is replaced by a more explicit message in the COPYRIGHT file.

Inspired by rust-lang/rust#43498 and rust-lang/rust#57108.
2020-01-02 14:10:09 +01:00
Guillaume Ayoub
2ce03092f1 Small code and style improvements around bookmark-state
Related to #870.
2019-05-23 23:55:56 +02:00
Gabriel Corona
34127350b6 Implement bookmark-state support 2019-05-19 19:31:32 +02:00
Guillaume Ayoub
840c4a6d92 Don't crash when using UTC timezones
Fix #862.
2019-05-14 15:32:17 +02:00
Guillaume Ayoub
167ebce065 Please isort again 2019-03-10 19:34:16 +01:00
Guillaume Ayoub
b7a9fe7dcc Update copyright 2019-03-04 11:04:06 +01:00
Guillaume Ayoub
0cc5478252 Fix imports for isort 2019-03-01 11:38:03 +01:00
Guillaume Ayoub
bdd45475b6 Clean a lot of things in API documentation 2019-02-22 11:34:46 +01:00
Guillaume Ayoub
498c275942 Fix tests because of a bug in Cairo
Cairo doesn't add links on empty pages, so we need to draw something on each
page in tests. This bug shouldn't happen with real life documents.

This issue appeared while fixing #780. Before that, empty pages were not empty
as they had at least an empty SVG drawn on the background.

See https://gitlab.freedesktop.org/cairo/cairo/issues/357
2019-01-30 22:48:21 +01:00
Guillaume Ayoub
c0d8af6738 Avoid rounding errors in tests 2018-12-29 16:58:11 +01:00
Guillaume Ayoub
b4500bf25e Fix more escape sequences 2018-10-26 15:32:34 +02: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
f41c95542d Set required version of cairo for tests 2018-08-06 18:17:31 +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
a455dfbfcb Fix tests with Python 3.5 2018-03-20 00:05:11 +01:00
Guillaume Ayoub
03b47f6a75 Clean PDF tests 2018-03-15 00:26:58 +01:00
Guillaume Ayoub
d0f0490890 Remove dead and old code from tests 2018-03-12 19:02:17 +01:00
Guillaume Ayoub
6e70f60c92 Use tmpdir fixture instead of custom code 2018-03-12 01:01:20 +01:00
Guillaume Ayoub
96e13204b4 I'd do anything to please the linters 2018-02-01 22:17:40 +01:00
Guillaume Ayoub
ce84073f1a Use Latin-1-decoded strings instead of bytestrings in pdfrw streams
Fix #558.
2018-01-28 16:21:48 +01:00
Guillaume Ayoub
16e8186568 Drop Python 2 support 2018-01-14 01:48:17 +01:00
Guillaume Ayoub
09bd0a3d39 Add tests for bleed 2017-10-05 08:45:22 +02:00
Guillaume Ayoub
f29d23b5dc Use pdfrw to edit PDF metadata and test them 2017-09-04 17:27:56 +02:00
Guillaume Ayoub
fcd6bf7070 Clean and document the logging levels
Related to #488.
2017-07-25 13:59:56 +02:00
Guillaume Ayoub
10ee68d432 Fix imports for this crazy nazisort 2017-06-03 15:46:37 +02:00
Simon Sapin
0aa62e249e Switch to tinycss2 2017-03-26 18:44:21 +02:00
Guillaume Ayoub
1215cb586a Allow relative URIs in anchors
Fix #437.

Backward-incompatible change: the signature of weasyprint.urls.url_join has
changed to allow relative links without a base URI.

This feature doesn't look really safe at first sight, but I can't find
anything bad coming from these changes. If there's a bug, I take the blame.
2017-03-25 18:28:41 +01:00
Guillaume Ayoub
4f4b4ed598 Use isort in tests 2017-03-25 00:33:36 +01:00
Guillaume Ayoub
fa371be749 Replace TestHTML by FakeHTML to please pytest3 2016-09-12 00:30:39 +02:00
Guillaume Ayoub
da96902bda Fix many PEP8 errors and warnings
- Put line breaks after operators (that's OK)
- Don't assign lambdas, use functions (well, that's really explicit in
  PEP8, it's really verbose but why not)
- Put imports at the beginning of the file (only special cases for us)
2016-01-15 12:48:25 +01:00
Alex Eftimie
93f497bf11 Replace utf8 with utf-8 for gettext compatibility 2015-11-25 09:38:01 +02:00
Simon Sapin
9b0488cff3 Fix PDF attachment tests to use a relative URL as intended. 2014-04-28 12:10:18 +01:00
Simon Sapin
dd9ff47c94 Fix code formatting 2014-04-27 18:16:14 +01:00
Colin Leitner
da916a32a6 Added an Attachment class for attachments provided through the API instead of the URL/description tuples 2014-04-25 23:35:43 +02:00
Colin Leitner
4f3e48dd8e Use temp_directory in favor of tempfile in the PDF embedded files testcase. 2014-04-23 16:53:32 +02:00
Colin Leitner
a084a5b517 Refactored attachments attribute from the HTML class to an argument for write_pdf 2014-04-22 20:40:46 +02:00
Colin Leitner
486834a099 Small whitespace fix 2014-04-22 19:32:01 +02:00
Colin Leitner
851167f19d Removed usage of unnecessary binascii module in favor of hexdigest 2014-04-22 19:29:37 +02:00
Colin Leitner
a9fd32c14c Change filename logic for PDF attachments
This patch honors the filename key of a fetched resource, which can be set by
the `Content-Disposition` or `Content-Type` headers and uses
`mimetypes.guess_extension` for resources that lack any indication of a
filename.
2014-04-18 16:40:47 +02:00
Colin Leitner
696df54d33 Avoid using the CWD during PDF tests with attachments relative to the document 2014-04-07 20:10:50 +02:00
Colin Leitner
44a6224d9f Moved imports to top of file 2014-04-07 20:07:56 +02:00
Colin Leitner
7ac01f0519 Added support for PDF file annotations. 2014-04-04 18:46:00 +02:00
Colin Leitner
e458380190 Added support for PDF attachments (v2) 2014-04-04 12:32:21 +02:00
Simon Sapin
c34221d215 2014. 2014-01-10 14:27:02 +00:00
Simon Sapin
eb08733938 Add PDF metadata parsed from HTML. Fix #77.
<title> → /Title
<meta name=author> → /Author
<meta name=description> → /Subject
<meta name=keywords> → /Keywords
<meta name=generator> → /Creator
<meta name=dcterms.created> → /CreationDate
<meta name=dcterms.modified> → /ModDate
"WeasyPrint vX.Y" → /Producer
2013-07-22 00:13:11 +01:00
Simon Sapin
bed4a41c41 Avoid duplicating the check for cairo MIME data support. 2013-06-18 15:18:05 +01:00
Simon Sapin
e8fac4b840 Fix #99: JPEG image not loading with cairo 1.8.x 2013-06-18 12:48:06 +01:00
Simon Sapin
1d1bf9cdc9 Flake8. 2013-04-11 12:08:53 +02:00
Simon Sapin
171438f48e 2013 2013-04-03 16:23:48 +02:00