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
df50204f3e Remove unsupported source lines 2017-07-01 00:28:14 +02:00
Guillaume Ayoub
f349f8b276 Make HTML inherit from cssselect2.ElementWrapper 2017-06-30 20:12:53 +02:00
Guillaume Ayoub
4a5fa84f9f Use cssselect2 instead of cssselect 2017-06-30 17:54:02 +02:00
Guillaume Ayoub
b53d9d3b1f Cut long lines, remove an old note 2017-04-29 10:41:53 +02:00
Hugh Secker-Walker
9376c95071 Fix typos and awkward grammar on Tutorial and API pages. 2017-04-28 14:36:14 -04:00
Tarashish Mishra
0fa6838c77 Let the logging module do the string interpolation 2017-03-28 13:02:50 +05:30
Guillaume Ayoub
4f4b4ed598 Use isort in tests 2017-03-25 00:33:36 +01:00
Guillaume Ayoub
152193cf77 Add the font configuration in LayoutContext
The font configuration is available (almost) everywhere it's needed,
@font-face doesn't rely on a global state anymore.
2016-10-27 17:36:24 +02:00
Guillaume Ayoub
d7b89dbb68 Clean the font config after rendering the document 2016-10-27 11:41:34 +02:00
Guillaume Ayoub
b5103d349f Create a new font config for each document 2016-10-26 17:17:00 +02:00
Guillaume Ayoub
b2a5d7a98f Add a presentational-hints option 2016-08-30 18:15:30 +02:00
Guillaume Ayoub
62c39b8029 Fix links with non-ASCII characters for Python 2
Fix #322.
2016-08-17 18:30:53 +02:00
Guillaume Ayoub
59e4fb5146 Change the way filenames are managed 2016-08-16 22:15:18 +02:00
Alex Eftimie
93f497bf11 Replace utf8 with utf-8 for gettext compatibility 2015-11-25 09:38:01 +02:00
Guillaume Ayoub
2d7f68e8a1 Use the same simple code for bookmark-labels and string-sets 2015-05-01 21:14:10 +02:00
Guillaume Ayoub
94ca04812e Cut long line 2015-04-29 09:32:33 +02:00
Johannes Duschl
94067db7ca This should fix #202. 2015-04-28 19:19:44 +02: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
8c06243c46 Use the new element_has_link_type instead of parsing the rel attribute manually. 2014-04-23 17:10:31 +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
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
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
Simon Sapin
52c06894b7 Docs: add an example combining documents into one PDF file. 2013-07-14 09:22:04 +01:00
Simon Sapin
1d1bf9cdc9 Flake8. 2013-04-11 12:08:53 +02:00
Simon Sapin
751d99cc78 Move background sizing and positioning from draw to layout. 2013-04-03 17:46:14 +02:00
Simon Sapin
171438f48e 2013 2013-04-03 16:23:48 +02:00
Simon Sapin
0f37260c24 Docs: mention converting pycairo contexts to cairocffi. 2013-03-28 16:41:51 +01:00
Simon Sapin
86bc8b4978 Fix #66: Resolve images’ auto width from non-auto height and intrinsic ratio. 2013-03-28 12:44:28 +01:00
Simon Sapin
c70b00b5b8 More WIP: cairocffi and pango cffi. 2012-12-29 01:36:06 +01:00
Simon Sapin
f243dbcca3 Embed JPEG-encoded images in PDF. Fix #6
If an image is in JPEG format, embed it as-is in the PDF output.
This often results in smaller PDF file size.

(The image is still decoded however,
so there is no rendering speed improvement.)
2012-12-20 20:12:52 +01:00
Simon Sapin
0444be5fba Fix PDF metadata with zoom != 1 2012-11-22 22:49:30 +01:00
Simon Sapin
85bbfa9258 Rename PDF scale to zoom, have the default be 1 rather than 0.75
The 0.75 factor is an implementation detail that should not be exposed
in the API.
2012-11-22 22:31:26 +01:00
mbarkhau
aa62d35664 Turn scale factor into parameter for write_pdf 2012-11-22 18:47:20 +01:00
Simon Sapin
3072fff2e5 Docs docs docs.
But no ducks.
2012-10-08 19:51:18 +02:00
Simon Sapin
a0bb1f2752 Have metadata account for CSS transforms. 2012-10-06 22:09:17 +02:00
Simon Sapin
28cb59fc8b Pre-compute transformation matricies.
… so that they are available when getting meta-data.
2012-10-06 11:26:55 +02:00
Simon Sapin
eda4bc604e Move resolution to *.write_png only. 2012-10-05 20:12:05 +02:00
Simon Sapin
e1f5863bc8 Refine docstrings. 2012-10-05 18:50:40 +02:00
Simon Sapin
a05470d006 Remove with_size in Document.write_png
The method now always returns a tuple with the size.
HTML.write_png however still does not return the size.
2012-10-05 18:27:45 +02:00
Simon Sapin
6e63903a13 Add metadata in the low-level API. 2012-10-04 13:06:41 +02:00
Simon Sapin
09ff532828 The Document is back! (But different.) 2012-10-02 18:59:02 +02:00
Simon Sapin
f33c91742d Get rid of the Document class (finally!) 2012-09-25 16:37:18 +02:00
Simon Sapin
6354398139 Add a low-level public API 2012-09-12 19:33:16 +02:00
Simon Sapin
463a33c1af Fetch background images early
This removes the need to have a reference to the image cache
in draw.py
2012-09-12 18:36:00 +02:00
Simon Sapin
43bccc7345 Remove the ContextProxy
Instead, pass around the two objects in every function.
This is a bit heavy, but I find it much cleaner.
2012-09-12 17:14:51 +02:00
Johan Dahlin
b0fb7a6e31 Convert drawing API to use context
Remove the need for a subclass and make it possible
to pass in other contextes such one created by the printing
functions in gtk+.
2012-09-12 16:31:00 +02:00
Simon Sapin
4abf401f9e Simplify Document and remove magic properties. 2012-08-03 13:00:14 +02:00
Simon Sapin
ec8cbc6c24 Remove one-line methods in Document. 2012-08-03 11:51:58 +02:00
Simon Sapin
1864d3365a s/medium/media_type/ s/user_agent_stylesheets/ua_stylesheets/ 2012-08-02 13:04:31 +02:00
Chung Wu
a51562149c Can specify the @media medium to use (defaults to print) 2012-08-01 19:09:48 -07:00
Simon Sapin
fb01c4c839 Work around getfilesystemencoding stupidity on Linux. 2012-07-30 12:01:20 +02:00
Simon Sapin
9447363f69 Do not pass Unicode filenames to pycairo.
Older versions (1.8 on py2) do not like that.
2012-07-28 15:28:35 +02:00
Simon Sapin
a0cf7c7617 Test url_fetcher, make it work on stylesheets 2012-07-13 13:21:59 +02:00
Simon Sapin
2768dea548 Add `url_fetcher` to the public API 2012-07-13 12:24:55 +02:00
Simon Sapin
d401e7241b Kill Document in layout/*.py 2012-07-12 17:13:21 +02:00
Simon Sapin
cca18bdfe9 Kill Document in pdf.py and text.py 2012-07-12 16:14:35 +02:00
Simon Sapin
30a5708373 Kill Document in formatting_structure/build.py and html.py 2012-07-12 15:54:22 +02:00
Simon Sapin
d038708b8b Kill Document in css/__init__.py 2012-07-12 15:21:37 +02:00
Simon Sapin
163b85bae4 Kill Document in draw.py 2012-07-12 15:13:08 +02:00
Simon Sapin
925669d37c Fix floats across pages. 2012-07-06 18:35:23 +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
Guillaume Ayoub
989ae739ef Merge branch 'master' into float
Comment failing tests too :(

Conflicts:
	weasyprint/document.py
	weasyprint/draw.py
2012-06-23 02:00:09 +02:00
Simon Sapin
541214ee71 Add a resolution parameter for PNG output in the public API.
The resolution is counted in PNG pixels per CSS inch.
Note however that CSS pixels are always 1/96 CSS inch.
With the default resolution of 96, CSS pixels match PNG pixels.
2012-06-22 08:49:48 +02:00
Guillaume Ayoub
cd1e5b3e05 Merge branch 'master' into float
Conflicts:
	weasyprint/layout/preferred.py
	weasyprint/text.py
2012-06-22 01:29:26 +02:00
Simon Sapin
040eb765df Remove backends in favor of methods on Document
This much genericity was not that useful.
2012-06-21 17:22:01 +02:00
Simon Sapin
97f3eee889 Refactor text handling
* Kill the TextFragment class. Use a set of functions instead.
* Pass around an `enable_hinting` boolean rather than a dummy surface
2012-06-21 17:22:01 +02:00
Guillaume Ayoub
c163f8e8eb Merge remote-tracking branch 'origin/master' into float
Conflicts:
	weasyprint/document.py
	weasyprint/tests/w3_test_suite/web.py
2012-06-21 15:28:22 +02:00
Simon Sapin
fc2fdb622c Add get_png_pages to the public API 2012-06-21 11:33:19 +02:00
Guillaume Ayoub
36a6b6b6f3 Pass the fixed_boxes argument instead of using current_page
Cherry-picked from 043d71dc29

Conflicts:
	weasyprint/layout/absolute.py
	weasyprint/layout/blocks.py
	weasyprint/layout/float.py
	weasyprint/layout/inlines.py
2012-06-19 18:00:50 +02:00
Guillaume Ayoub
f9e7c40ca2 Fix the drawing order of fixed boxes
Cherry-picked from 568e0aeb70

Conflicts:
	weasyprint/layout/blocks.py
	weasyprint/layout/inlines.py
2012-06-19 17:42:15 +02:00
Guillaume Ayoub
043d71dc29 Pass the fixed_boxes argument instead of using current_page 2012-06-06 12:04:09 +02:00
Guillaume Ayoub
568e0aeb70 Fix the drawing order of fixed boxes 2012-06-06 09:49:56 +02:00
Guillaume Ayoub
c00881790c Increase the auto height of block formatting context roots 2012-05-31 22:33:28 +02:00
Simon Sapin
ffd03a578b Merge branch 'master' into float 2012-05-31 17:56:31 +02:00
Simon Sapin
4f4c99e35c Remove unused imports. 2012-05-31 14:41:01 +02:00
Simon Sapin
037e4b955c Merge branch 'master' into float 2012-05-30 19:08:48 +02:00
Guillaume Ayoub
6449ee4cbf Absolute doesn't work yet, but much better than before 2012-05-30 03:27:08 +02:00
Simon Sapin
a394ab5762 Work around cairo to make sure SVG image stay vectors. 2012-05-29 19:11:10 +02:00
Guillaume Ayoub
f978dd6963 Add untested support for position: fixed 2012-05-23 11:30:52 +02:00
Simon Sapin
b6ea3821b8 Remove unused imports 2012-05-22 16:34:41 +02:00
Simon Sapin
61dc177573 Refactor the PNG/PDF differences into a new 'backends' module. 2012-05-22 16:19:09 +02:00
Simon Sapin
ec91ed5ae4 Remove cached_property
Use normal properties with an explicit cache instead.
2012-05-22 15:04:20 +02:00
Simon Sapin
33cd706f0d Refactor the metadata stuff into the pdf module. 2012-05-20 17:04:22 +02:00
Simon Sapin
b1b5d85b41 Write bookmarks and links with the new PDF module. 2012-05-20 15:55:57 +02:00
Simon Sapin
8b994c2ec6 Use the new pdf module. 2012-05-20 13:56:04 +02:00
Simon Sapin
699af8a9f5 Remove the old pdf module. 2012-05-20 13:55:07 +02:00
Simon Sapin
c828f3835d Avoid using OrderedDict (for Python 2.6). 2012-05-18 17:18:58 +02:00
Guillaume Ayoub
bfeb102c98 Test bookmarks 2012-05-18 15:38:57 +02:00
Guillaume Ayoub
64cb7b4104 Handle the bookmarks as a tree 2012-05-17 22:46:03 +02:00
Guillaume Ayoub
111932edf5 Add first-level bookmarks, use floats for XY positions, fix little things 2012-05-15 19:29:54 +02:00
Guillaume Ayoub
76c15235e6 Replace the PDF class by a function 2012-05-15 03:29:57 +02:00
Guillaume Ayoub
22635c0c71 Initial support of internal links 2012-05-14 19:40:38 +02:00
Guillaume Ayoub
9ea53bf466 Add initial support of external hyperlinks 2012-05-14 18:31:51 +02:00
Simon Sapin
dcacf9eed0 Switch the licence to BSD and rewrite module docstrings/headers 2012-03-21 23:26:58 +01:00
Simon Sapin
26de362b99 Add proper attribution in AUTHORS 2012-03-21 18:40:38 +01:00