Feature #10715
closed
wkhtmltopdf ersetzen: puppeteer
Added by Marc Egger almost 4 years ago.
Updated over 2 years ago.
Description
Prio4 von Nicola
Varianten:
Tools¶
Diese koennen vermutlich alle kein JS, sind dafuer aber als LIB oder API sehr schnell:
Files
- Description updated (diff)
- Subject changed from wkhtmltopdf ersetzen to wkhtmltopdf ersetzen: puppeteer
- Priority changed from Normal to High
- Target version changed from next5 to next3
- Description updated (diff)
- Description updated (diff)
Test¶
Umgebung¶
# Test als npm - Installation hat funktioniert, aber das Binary blieb haengen
# FALSCH: CR hat einfach nur nicht lange genug gewartet. Beim ersten Start wird in das Home des users ein kompletter Chrome geladen!!! >300MB
[root@host]
$ npm install -g crpdf
# Aufruf bleibt haengen
$ crpdf https://math.uzh.ch final.pdf
# Installation des fertigen Linux Pakets https://github.com/JorgenEvens/crPDF/releases
[root@host] mv /var/tmp/crpdf /usr/local/bin/crpdf-pkg
# Aufruf OK fuer root UND fuer www-data
[root@host] cd; crpdf-pkg 'http://webwork16.math.uzh.ch/crose/qfq/index.php?id=annotatefabric&form=annotateGraphic&r=1' final.pdf
[www-data@host] cd; crpdf-pkg 'http://webwork16.math.uzh.ch/crose/qfq/index.php?id=annotatefabric&form=annotateGraphic&r=1' final.pdf
- Assignee changed from Carsten Rose to Benjamin Baer
- Start date changed from 04.06.2020 to 08.06.2021
Liste der wkhtml Optionen: https://wkhtmltopdf.org/usage/wkhtmltopdf.txt
Ziel: zumindest die aktuell verwendeten Optionen sollten funktionieren.
Wichtig sind die Cookies. Achtung : in dem --cookie-jar File werden alle aktuellen Cookies kopiert (QFQ, FE, PHP, ...)
user arguments
------------------
--margin-bottom=20mm
--footer-left="Seite: [page]/[toPage]"
--footer-right="1234, UZH Doc.Mobility"
--footer-font-size=8
--footer-spacing=10
QFQ added arguments
-------------------
--cookie-jar ‘/tmp/qfq.cookie….’
'--custom-header User-Agent ' . escapeshellarg($_SERVER['HTTP_USER_AGENT'] ?? '')
--custom-header-propagation
- crpdf (Puppeteer) von Benj: https://git.math.uzh.ch/utilities/crPDF/-/tree/master
- Das json Array muss wie folgt aussehen:
{"cookies": [
{
"name": "test",
"value": "3fh822ji4f244",
"domain": "w16.math.uzh.ch",
"path": "/my/"
},
{
"name": "mondieux",
"value": "oh mon dieux",
"domain": "w16.math.uzh.ch",
"path": "/my/"
}
]}
- Target version changed from next3 to next2
- Related to Bug #10704: wkhtml problem rendering fullCalendar.js / fabric.js >> successor: puppeteer added
- Status changed from New to Closed
- Target version changed from next2 to 355
- Target version changed from 355 to 21.12.0
Also available in: Atom
PDF