Commit 9a50deca authored by Carsten  Rose's avatar Carsten Rose
Browse files

Manual.rst: Add notes to QFQ installation, wkhtml problems, paragraph on 'sendEmail'

Html2Pdf.php: Add error codes and a hint on wkhtml fails.
parent 4ab083ca
...@@ -32,12 +32,14 @@ General ...@@ -32,12 +32,14 @@ General
Installation Installation
============ ============
The following features are only tested on linux hosts: The following features are only tested / supported on linux hosts:
* General: QFQ is coded to run on Linux hosts, preferable on Debian derivates like Ubuntu.
* HTML to PDF conversion - command `wkhtmltopdf`. * HTML to PDF conversion - command `wkhtmltopdf`.
* Concatenation of PDF files - command `pdftk`. * Concatenation of PDF files - command `pdftk`.
* Mime type detection for uploads - command `file`. * Mime type detection for uploads - command `file`.
.. _`preparation`: .. _`preparation`:
Preparation Preparation
...@@ -108,6 +110,10 @@ Typosript) from specific IPs **or** if a FE-User is logged in. ...@@ -108,6 +110,10 @@ Typosript) from specific IPs **or** if a FE-User is logged in.
If there are problems with converting/downloading FE_GROUP protected pages, check `SHOW_DEBUG_INFO = download` to debug. If there are problems with converting/downloading FE_GROUP protected pages, check `SHOW_DEBUG_INFO = download` to debug.
**Important**: Converting HTML to PDF gives no error message but RC=-1? Check carefully all includes of CSS, JS, images
and so on! Typically some of them fails to load and wkhtml stops running!
HTML to PDF conversion HTML to PDF conversion
'''''''''''''''''''''' ''''''''''''''''''''''
...@@ -133,6 +139,20 @@ Typoscript code to implement a print link on every page:: ...@@ -133,6 +139,20 @@ Typoscript code to implement a print link on every page::
data = page:uid data = page:uid
} }
Send Email
^^^^^^^^^^
QFQ sends mail via `sendEmail` http://caspian.dotconf.net/menu/Software/SendEmail/ - a small perl script without a central
configuration.
By default, `sendEmail` uses the local installed MTA, writes a logfile to `typo3conf/mail.log` and handles attachments
via commandline options. A basic HTML email support is implemented.
The latest version is v1.56, which has at least one bug. That one is patched in the QFQ internal version v1.56p1 (see
QFQ GIT sources in directory 'patches/sendEmail.patch').
The Typo3 sendmail eco-system is not used at all.
Setup Setup
----- -----
...@@ -382,7 +402,7 @@ Example: *typo3conf/config.qfq.ini* ...@@ -382,7 +402,7 @@ Example: *typo3conf/config.qfq.ini*
DB_1_NAME = qfq_db DB_1_NAME = qfq_db
DB_INIT = set names utf8 DB_INIT = set names utf8
; DB_INDEX_DATA = 1 ; DB_INDEX_DATA = 1
; DB_INDEX_QFQ = 1 ; DB_INDEX_QFQ = 1
; SQL_LOG = sql.log ; SQL_LOG = sql.log
; SQL_LOG_MODE = modify ; SQL_LOG_MODE = modify
; SHOW_DEBUG_INFO = auto ; SHOW_DEBUG_INFO = auto
...@@ -450,8 +470,8 @@ Example: *typo3conf/config.qfq.ini* ...@@ -450,8 +470,8 @@ Example: *typo3conf/config.qfq.ini*
;DOCUMENTATION_QFQ = https://docs.typo3.org/typo3cms/drafts/github/T3DocumentationStarter/Public-Info-053/Manual.html ;DOCUMENTATION_QFQ = https://docs.typo3.org/typo3cms/drafts/github/T3DocumentationStarter/Public-Info-053/Manual.html
;FILL_STORE_SYSTEM_BY_SQL_1 = 'SELECT s.id AS periodId FROM Period AS s WHERE s.start<=NOW() ORDER BY s.start DESC LIMIT 1' ;FILL_STORE_SYSTEM_BY_SQL_1 = 'SELECT s.id AS periodId FROM Period AS s WHERE s.start<=NOW() ORDER BY s.start DESC LIMIT 1'
; Important: only define an error message, if QFQ should stop running in case of an error or not exact 1 record. ; Important: only define an error message, if QFQ should stop running in case of an error or not exact 1 record.
;FILL_STORE_SYSTEM_BY_SQL_ERROR_MSG_1 = No current period found ;FILL_STORE_SYSTEM_BY_SQL_ERROR_MSG_1 = No current period found
;FORM_LANGUAGE_A_ID = 1 ;FORM_LANGUAGE_A_ID = 1
;FORM_LANGUAGE_A_LABEL = english ;FORM_LANGUAGE_A_LABEL = english
...@@ -5018,7 +5038,7 @@ Example `_pdf`, `_zip`: :: ...@@ -5018,7 +5038,7 @@ Example `_pdf`, `_zip`: ::
.. ..
Use the `--print-media-type` as wkthml option to access the page with media type 'printer'. Depending on the website Use the `--print-media-type` as wkhtml option to access the page with media type 'printer'. Depending on the website
configuration this switches off navigation and background images. configuration this switches off navigation and background images.
Rendering 'official' look-alike PDF letters Rendering 'official' look-alike PDF letters
......
...@@ -276,6 +276,9 @@ const ERROR_MISSING_SESSIONNAME = 2400; ...@@ -276,6 +276,9 @@ const ERROR_MISSING_SESSIONNAME = 2400;
const ERROR_QFQ_SESSION_MISSING = 2401; const ERROR_QFQ_SESSION_MISSING = 2401;
const ERROR_SESSION_BROKEN_SCRIPT_PATH = 2402; const ERROR_SESSION_BROKEN_SCRIPT_PATH = 2402;
const ERROR_HTML2PDF_MISSING_CONFIG = 2500;
const ERROR_HTML2PDF_WKHTML_NOT_EXECUTABLE = 2501;
const ERROR_HTML2PDF_WKHTML_FAILED = 2502;
// //
// Store Names: Identifier // Store Names: Identifier
// //
......
...@@ -67,15 +67,15 @@ class Html2Pdf { ...@@ -67,15 +67,15 @@ class Html2Pdf {
$this->config = $config; $this->config = $config;
if (!isset($config[SYSTEM_BASE_URL_PRINT]) || $config[SYSTEM_BASE_URL_PRINT] == '') { if (!isset($config[SYSTEM_BASE_URL_PRINT]) || $config[SYSTEM_BASE_URL_PRINT] == '') {
throw new \exception(CONFIG_INI . ' - Missing ' . SYSTEM_BASE_URL_PRINT); throw new \exception(CONFIG_INI . ' - Missing ' . SYSTEM_BASE_URL_PRINT, ERROR_HTML2PDF_MISSING_CONFIG);
} }
if (!isset($config[SYSTEM_WKHTMLTOPDF]) || $config[SYSTEM_WKHTMLTOPDF] == '') { if (!isset($config[SYSTEM_WKHTMLTOPDF]) || $config[SYSTEM_WKHTMLTOPDF] == '') {
throw new \exception(CONFIG_INI . ' - Missing ' . SYSTEM_WKHTMLTOPDF); throw new \exception(CONFIG_INI . ' - Missing ' . SYSTEM_WKHTMLTOPDF, ERROR_HTML2PDF_MISSING_CONFIG);
} }
if (!is_executable($config[SYSTEM_WKHTMLTOPDF])) { if (!is_executable($config[SYSTEM_WKHTMLTOPDF])) {
throw new \exception(CONFIG_INI . ' - ' . SYSTEM_WKHTMLTOPDF . '=' . $config[SYSTEM_WKHTMLTOPDF] . ' - not found or not executable.'); throw new \exception(CONFIG_INI . ' - ' . SYSTEM_WKHTMLTOPDF . '=' . $config[SYSTEM_WKHTMLTOPDF] . ' - not found or not executable.', ERROR_HTML2PDF_WKHTML_NOT_EXECUTABLE);
} }
$this->session = Session::getInstance($phpUnit); $this->session = Session::getInstance($phpUnit);
...@@ -226,7 +226,8 @@ class Html2Pdf { ...@@ -226,7 +226,8 @@ class Html2Pdf {
$line = system($cmd, $rc); $line = system($cmd, $rc);
if ($rc != 0) { if ($rc != 0) {
throw new \exception("Error [RC=$rc] $line: $cmd"); throw new \exception("Error [RC=$rc] $line: $cmd - in case of trouble: check carefully that *all* CSS, JS, " .
"images are accessible. 'wkhtml' does not report problems but fails.", ERROR_HTML2PDF_WKHTML_FAILED);
} }
return $filename; return $filename;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment