Commit c14126b7 authored by Carsten  Rose's avatar Carsten Rose
Browse files

Manual.rst: Notes for wkhtmltopdf. Fixed _download/_pdf issues.

parent a134e2cb
......@@ -48,17 +48,20 @@ Preparation steps for Ubuntu 16.04::
sudo apt install php7.0-intl
Print page via wkhtmltopdf
^^^^^^^^^^^^^^^^^^^^^^^^^^
wkhtmltopdf: print page / convert HTML to PDF
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Different browser prints the same page in different variations. To prevent this, QFQ implements a small PHP wrapper `print.php`
which uses http://wkhtmltopdf.org/ (webkit based) to convert HTML to PDF. The converter is not included in QFQ and has
to be manually installed.
which uses http://wkhtmltopdf.org/ (webkit based) to convert HTML to PDF. The converter is also during `download`_ to
convert HTML to PDF. The converter is not included in QFQ and has to be manually installed.
Hint: The Ubuntu package `wkhtmltopdf` needs a running Xserver - this does not work on a headless webserver. Best is to
install the QT version from the named website above.
Hint:
* The Ubuntu package `wkhtmltopdf` needs a running Xserver - this does not work on a headless webserver. Best is to
install the QT version from the named website above.
* FE_GROUP protected pages/tt-content are not accessible via `wkhtmltopdf`.
* SIPs can't be used via `wkhtmltopdf`.
In config.qfq.ini specify the:
In `config-qfq-ini`_ specify the:
* installed `wkhtmltopdf` binary,
* the site base URL.
......@@ -3238,7 +3241,8 @@ Special column names
+------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|_pageX or _PageX |Shortcut version of the link interface for fast creation of internal links. The column name is composed of the string *page*/*Page* and a optional character to specify the type of the link.|
+------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|_download or _Download |Shortcut version of the link interface for fast creation of download links. Used to offer single file download or to concatenate severral PDFs and printout of websites to one PDF file. |
|_pdf, _file, _zip |Shortcut version of the link interface for fast creation of `download`_ links. Used to offer single file download or to concatenate several PDFs and printout of websites to one PDF file. |
|_Pdf, _File, _Zip | |
+------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|_sendmail |Send emails. |
+------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
......@@ -3303,7 +3307,7 @@ Column: _link
+---+---+--------------+-----------------------------------+---------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
| | |Tooltip |o:<text> |o:More information here |Tooltip text |
+---+---+--------------+-----------------------------------+---------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
| | |Alttext |a:<text> |a:Name of person |a) Alttext for images, b) Message text for download popup window. |
| | |Alttext |a:<text> |a:Name of person |a) Alttext for images, b) Message text for `download`_ popup window. |
+---+---+--------------+-----------------------------------+---------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
| | |Class |c:[n|i|e|<text>] |c:i |CSS class for link. n:no class attribut, i:internal (ext_localconf.php)(default), e:external (ext_localconf.php), <text>: explicit named|
+---+---+--------------+-----------------------------------+---------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
......@@ -3456,10 +3460,10 @@ The downloads are SIP protected. Only the current user can use the link to downl
By using the `_link` columnname:
* the option `d` initiate creating the download link and optional specifies an export filename,
* the optional `M` (Mode) specifies the export type (file, pdf, excel, zip),
* setting `s` (or `s=1`) is mandatory for the download function,
* the alttext `a` specifies a message in the dowload popup.
* the option `d:...` initiate creating the download link and optional specifies an export filename,
* the optional `M:...` (Mode) specifies the export type (file, pdf, excel, zip),
* setting `s:1` is mandatory for the download function,
* the alttext `a:...` specifies a message in the dowload popup.
By using `_pdf`, `_Pdf`, `_file`, `_File`, `_excel`, `_Excel`, `_zip`, `_Zip` as columnname the options `d`, `m` and `s`
will be set by automatically.
......@@ -3478,13 +3482,16 @@ Parameter and (element) sources
* *download*: `d[:<exportFilename>]`
* *exportFilename* = <filename for save as> - Name, offered in the 'File save as' browser dialog. Default: 'output.<ext>'.
If there is no `exportFilename` defined and `mode=file`, than the original filename is taken. If the mimetype is
different from the `exportFilename` extension, then the mimetype extension will be added to `exportFilename`. This
guarantees that a filemanager will open the file with the correct application.
If there is no `exportFilename` defined and `mode=file`, than the original filename is taken.
If the mimetype is different from the `exportFilename` extension, then the mimetype extension will be added to
`exportFilename`. This guarantees that a filemanager will open the file with the correct application.
The user typically expect meaningful and distinct filenames for different download links.
* *popupMessage*: `a:<text>` - will be displayed in the popup window during download. If the creating/download is fast,
the window might disapear quicly.
the window might disappear quickly.
* *mode*: `m:<mode>`
......@@ -3496,8 +3503,8 @@ Parameter and (element) sources
* In case of multiple element sources, only `pdf` or `zip` is supported.
* `m:excel` is not implemented now.
* If `m:zip` is used together with `U:...` oder `u:..`, those HTML pages will be converted to PDF and have technical
filenames inside the archive.
* If `m:zip` is used together with `U:...` oder `u:..`, those HTML pages will be converted to PDF. Those files
get generic filenames inside the archive.
* If not specified, the **default** depends on the number of specified element sources (=file or web page).
* If only one `file` is specifed, the default is `file`.
......@@ -3508,7 +3515,11 @@ Parameter and (element) sources
* *file*: `f:<pathFilename>` - relative or absolute pathFilename offered for a) download (single), or to be concatenated
in a PDF or ZIP.
* *urlParam*: `U:id=<t3 page>&<key 1>=<value 1>&<key 2>=<value 2>&...&<key n>=<value n>`
* *urlParam*: `U:id=<t3 page>&<key 1>=<value 1>&<key 2>=<value 2>&...&<key n>=<value n>`.
It's not possible to pass a valid SIP via `urlParam` to the target (wkhtmltopdf has no valid PHP session).
Also there are no FE_USER or FE_GROUP available.
* *url*: `u:<url>` - any URL, pointing to an internal or external destination.
......@@ -3948,7 +3959,7 @@ Most of the other Link-Class attributes can be used to customize the link.
* Parameter are position independent.
* *<params>*: see ref:`download-parameter-files`
* *<params>*: see `download-parameter-files`_
* For column `_pdf` and `_zip`, the element sources `U:...`, `u:...`, `f:...` might repeated multiple times.
* Example: ::
......@@ -3981,7 +3992,7 @@ A limited set of attributes is supported: ::
SELECT "||fileadmin/test.pdf" AS _File, "||fileadmin/test.pdf" AS _Pdf, "||fileadmin/test.pdf" AS _Zip
SELECT "output.pdf|Download PDF|fileadmin/test.pdf" AS _File, "output.pdf|Download PDF|fileadmin/test.pdf" AS _Pdf, "output.zip|Download ZIP|fileadmin/test.pdf" AS _Zip
SELECT "complete.pdf|Download ZIP|fileadmin/test1.pdf|fileadmin/test2.pdf|id=export&r=1" AS _pdf
SELECT "complete.pdf|Download PDF|fileadmin/test1.pdf|fileadmin/test2.pdf|id=export&r=1" AS _Pdf
..
......
......@@ -357,7 +357,7 @@ class Link {
}
/**
* Order $param
* Order $param. Parameter with Priotrity are hardcoded at the moment.
*
* @param array $param
* @return array
......@@ -379,6 +379,7 @@ class Link {
return array_merge($prio, $regular);
}
/**
* @param string $str
* @param array $tokenGiven
......
Markdown is supported
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