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

75 Commits

Author SHA1 Message Date
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
e244b8119b Renamed is_internal to link_type, which is less confusing 2014-04-23 17:12:54 +02:00
Colin Leitner
b7a5c46626 Moved the UTF-8 decoding logic from compat.py to pdf.py, where it's actually necessary to special case the unquoted result 2014-04-22 21:48:11 +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
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
846a5bedb4 Refactored the url_fetcher argument for write_pdf to an attribute of the Document class 2014-04-18 15:11:45 +02:00
Colin Leitner
83ef0e9c17 Use write_new_object where applicable in _write_compressed_file_object and check that the object numbers are still in sync 2014-04-07 20:03:30 +02:00
Colin Leitner
17f81862ff Refactored write_compressed_file_object to a top-level function 2014-04-07 19:55:23 +02:00
Colin Leitner
ff89ef0a73 Removed unnecessary PDF output simplification for empty unicode strings 2014-04-07 19:48:33 +02:00
Colin Leitner
12734323f4 Fixed an expression which led to a KeyError for internal links. 2014-04-06 15:37:25 +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
Florian Mounier
e3d7bad55b Be careful logging.warn is deprecated 2013-08-19 14:38:09 +02: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
Pierre-Alain Mignot
76b87c82f4 Fix #101: Write PDF bookmarks/outline correctly.
The PDF spec says that the target of a bookmark/outline entry contains
the *object ID* of the target page. We previously wrote the *page number*,
which for some reason still worked in some PDF viewers.
2013-06-28 18:33:14 +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
Simon Sapin
c70b00b5b8 More WIP: cairocffi and pango cffi. 2012-12-29 01:36:06 +01:00
Simon Sapin
0444be5fba Fix PDF metadata with zoom != 1 2012-11-22 22:49:30 +01:00
Simon Sapin
54b46c4b46 Typo fix 2012-10-08 12:13:33 +02:00
Simon Sapin
a7131bd10f Remove unused imports 2012-10-05 22:12:19 +02:00
Simon Sapin
ba06e7eecc Nicer whitespace in PDF objects. 2012-10-05 22:06:38 +02:00
Simon Sapin
732f7187a4 Fix bookmarks writing in PDF.
The new prepare_metadata() already adds bookmark_root_id to
all values, no need to add it again in write_pdf_metadata()
2012-10-05 21:59:08 +02:00
Simon Sapin
bedcbfe4ed Remove a debugging print() 2012-10-05 21:50:37 +02:00
Simon Sapin
eda4bc604e Move resolution to *.write_png only. 2012-10-05 20:12:05 +02:00
Simon Sapin
6e63903a13 Add metadata in the low-level API. 2012-10-04 13:06:41 +02:00
Simon Sapin
a85c137754 Bug fix: unit conversion for PDF metadata. 2012-09-24 12:46:11 +02:00
Simon Sapin
7966e9fed6 Generalize hinting and resolution
... in the low-level API, not just PNG output.
2012-09-20 19:24:58 +02:00
Simon Sapin
20fe60040d Document low-level output functions. 2012-09-20 17:57:15 +02:00
Simon Sapin
ac220e9a4d Refactor the PNG output to use the low-level API
… not intermediate ImageSurface objects.
2012-09-18 12:58:58 +02:00
Simon Sapin
6354398139 Add a low-level public API 2012-09-12 19:33:16 +02:00
Simon Sapin
30533879b2 Fixed #2: Crash in PDF outlines with malformed bookmark-level sequence. 2012-07-23 16:12:45 +02:00
Simon Sapin
cca18bdfe9 Kill Document in pdf.py and text.py 2012-07-12 16:14:35 +02:00
Simon Sapin
fb3777b317 Get rid of page.outer_width and outer_height
.margin_width() and .margin_height() can be used instead.
2012-07-03 14:07:39 +02:00
Simon Sapin
78461b81f1 Test the Navigator 2012-06-23 04:58:14 +02:00
Simon Sapin
8497a7fc90 Fix the tests on PDF links 2012-06-14 22:06:30 +02:00
Simon Sapin
34ae5ec116 Remove redundant links on text boxes; Browser polish 2012-06-14 21:09:59 +02:00
Simon Sapin
b98820df5b Switch from margin area to border area for the link "hit box" 2012-06-14 20:11:12 +02:00
Simon Sapin
95e0ad2707 Warn instead of crash on missing on #foo without id="foo" 2012-06-01 18:32:43 +02:00
Simon Sapin
d694a98350 Rename the utils module to 'urls' 2012-05-23 15:13:57 +02:00
Simon Sapin
848bf33f87 Have PDF readers display the bookmarks by default.
... although evince seems to just ignore it.
2012-05-22 14:47:50 +02:00
Simon Sapin
267010a930 Rename destinations to anchors for internal hyperlinks. 2012-05-22 12:37:48 +02:00
Simon Sapin
d7676f8081 Test hyperlinks, fix internal hyperlink parsing. 2012-05-21 18:43:08 +02:00
Simon Sapin
866efdf62c Do not repeat bookmarks on a fragmented box
Also a better way not to repeat margin/padding/border and list markers.
2012-05-21 14:22:32 +02:00
Simon Sapin
33cd706f0d Refactor the metadata stuff into the pdf module. 2012-05-20 17:04:22 +02:00
Simon Sapin
1b3f7d478f Test the PDF parser (but not writer) 2012-05-20 16:11:50 +02:00
Simon Sapin
b1b5d85b41 Write bookmarks and links with the new PDF module. 2012-05-20 15:55:57 +02:00