forked from mouthwateringmedia/python_pdf_presentation
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpresentation.txt
More file actions
106 lines (89 loc) · 3.07 KB
/
presentation.txt
File metadata and controls
106 lines (89 loc) · 3.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
Starting up Powerpoint
⌛
#####
ಠಠ I see you are trying to show
📎 a presentation in a terminal.
#####
Automating PDFs with Python and command-line tools
by Edwin Grubbs <egrubbs@mwmdigital.com>
https://github.com/mouthwateringmedia/python_pdf_presentation
#####
Automating PDFs with Python and command-line tools
by Edwin Grubbs <egrubbs@mwmdigital.com>
https://github.com/mouthwateringmedia/python_pdf_presentation
ಠಠ Would you like a shorter url? |
📎 http://goo.gl/rDmfxG |
#####
Software Used:
----------------------------------------
* http://wkhtmltopdf.org/ *
| 99% of the work |
* http://mstamy2.github.io/PyPDF2/ *
| concatenation & merging |
* http://www.reportlab.com/opensource/ *
| much faster than wkhtmltopdf |
| for minor edits |
#####
* tar -xJvf wkhtmltox-...tar.xz *
---------------------------------------------
| wkhtmltox/bin/wkhtmltopdf (35 MB) |
| wkhtmltox/bin/wkhtmltoimage |
| wkhtmltox/lib/libwkhtmltox.so.0.12.0 |
| wkhtmltox/include/wkhtmltox/image.h |
| wkhtmltox/include/wkhtmltox/dllbegin.inc |
| wkhtmltox/include/wkhtmltox/dllend.inc |
| wkhtmltox/include/wkhtmltox/pdf.h |
On Linux: 14M compressed / 111 MB uncompressed
#####
wkhtmltopdf is webkit based so testing with Chrome
or Safari will generate similar results.
For some reason landscape mode needs to be
zoomed out to be the same size as portrait mode.
----------------------------
| @media print { |
| @page { |
| size: landscape; |
| margin: 0.25in; |
| } |
| body { |
| zoom: 0.75; |
| } |
| } |
#####
There are two HTML standards for printing headers and footers.
wkhtmltopdf doesn't support either of them.
--------------------------------------------
| @media print { |
| thead {display: table-header-group;} |
| } |
--------------------------------------------
| @page { |
| @top-center { |
| content: element(pageHeader); |
| } |
| } |
| #pageHeader { |
| position: running(pageHeader); |
| } |
#####
Fortunately, wkhtmltopdf provides the
--header-html and --footer-html options.
It is very important that your header
and footer contain <!DOCTYPE html>
and the css below.
-----------------------------
| <!DOCTYPE html> |
| <html> |
| <head> |
| <style> |
| html, body { |
| height: 1.5in; |
| margin: 0; |
| padding: 0; |
| overflow: hidden; |
| } |
| </style> |
| </head> |
#####
Useful links:
| https://github.com/incuna/django-wkhtmltopdf |