Use headless Chrome instead of wkhtmltopdf

This commit is contained in:
rubenwardy 2017-08-26 18:01:49 +01:00
parent 380027cd75
commit 381097c839

View File

@ -6,5 +6,20 @@ oldCWD="$PWD"
cd $(dirname $0)
cd ../en/
wkhtmltopdf --print-media-type {% for link in site.data.links_en %}{% if link.link %}{{ link.link }} {% endif %}{% endfor %} out.pdf
mv out.pdf $oldCWD/book.pdf
#wkhtmltopdf --print-media-type {% for link in site.data.links_en %}{% if link.link %}{{ link.link }} {% endif %}{% endfor %} out.pdf
#mv out.pdf $oldCWD/book.pdf
{% for link in site.data.links_en %}
{% if link.link %}
/opt/google/chrome/google-chrome --headless --disable-gpu --print-to-pdf file:///${PWD}/{{ link.link }}
{% if link.num %}
mv output.pdf page_{{ link.num }}.pdf
{% else %}
mv output.pdf page_0_{{ link.link | replace:".","_" }}.pdf
{% endif %}
{% endif %}
{% endfor %}
pdfunite page*.pdf ${oldCWD}/book.pdf