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

73 Commits

Author SHA1 Message Date
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