Newer
Older

Carsten Rose
committed
.. ==================================================

Carsten Rose
committed
.. Header hierarchy

Carsten Rose
committed
.. ==
.. --
.. ^^

Carsten Rose
committed
.. ""

Carsten Rose
committed
.. ;;
.. ,,
..
.. --------------------------------------------used to the update the records specified ------

Carsten Rose
committed
.. Best Practice T3 reST: https://docs.typo3.org/m/typo3/docs-how-to-document/master/en-us/WritingReST/CheatSheet.html
.. Reference: https://docs.typo3.org/m/typo3/docs-how-to-document/master/en-us/WritingReST/Index.html
.. Bold **bold**
.. Code ``text``
.. External Links: `Bootstrap <http://getbootstrap.com/>`_

Carsten Rose
committed
.. Add Images: .. image:: ../images/a4.jpg

Carsten Rose
committed
..

Carsten Rose
committed
..
.. Admonitions
.. .. note:: .. important:: .. tip:: .. warning::
.. Definition:
.. some text becomes strong (only one line)
.. description has to indented

Carsten Rose
committed
.. -*- coding: utf-8 -*- with BOM.
.. include:: Includes.txt

Carsten Rose
committed
.. _general:
General
=======
* Project homepage: https://qfq.io
* Development: https://git.math.uzh.ch/typo3/qfq

Carsten Rose
committed
.. _installation:
Installation
============

Carsten Rose
committed
The following features are only tested / supported on linux hosts:

Carsten Rose
committed

Carsten Rose
committed
* General: QFQ is coded to run on Linux hosts, preferable on Debian derivates like Ubuntu.

Carsten Rose
committed
* HTML to PDF conversion - command `wkhtmltopdf`.

Carsten Rose
committed
* Concatenation of PDF files - command `pdfunite`.

Carsten Rose
committed
* PDF decrypt (used for merge with pdfunite) - command `qpdf`.
* PDF decrypt (used for merge with pdfunite) - command `gs` - in case `qpdf` is not successful.

Carsten Rose
committed
* Mime type detection for uploads - command `file`.

Carsten Rose
committed
.. _`preparation`:

Carsten Rose
committed
Preparation
-----------
Report & Form
^^^^^^^^^^^^^
To normalize UTF8 input, *php-intl* package is needed by

Carsten Rose
committed
* normalizer::normalize()
For the `download`_ function, the programs `pdfunite`, `qpdf`, `gs` and `file` are necessary to concatenate PDF files.

Carsten Rose
committed

Carsten Rose
committed
sudo apt install poppler-utils libxrender1 file pdf2svg pdfunite qpdf ghostscript # for file upload, PDF and 'HTML to PDF' (wkhtmltopdf), PDF split
sudo apt install inkscape imagemagick # to render thumbnails
wkhtmltopdf
^^^^^^^^^^^

Carsten Rose
committed

Carsten Rose
committed
`wkhtmltopdf <http://wkhtmltopdf.org/>`_ will be used by QFQ to offer 'website print' and 'HTML to PDF' conversion.
The program is not included in QFQ and has to be manually installed.

Carsten Rose
committed
* 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.
* In case of trouble with wkhtmltopdf, also install 'libxrender1'.

Carsten Rose
committed
* The current version 0.12.4 might have trouble with https connections. Version 0.12.5-dev (github master branch)
seems more reliable. Please contact the QFQ authors if you need a compiled Ubuntu version of wkhtmltopdf.

Carsten Rose
committed

Carsten Rose
committed
config.cmdWkhtmltopdf: /opt/wkhtmltox/bin/wkhtmltopdf
config.baseUrl: http://www.example.com/

Carsten Rose
committed
If wkhtml has been compiled with dedicated libraries (not part of LD_LIBRARY_PATH), specify the LD_LIBRARY_PATH together

Carsten Rose
committed
config.cmdWkhtmltopdf: LD_LIBRARY_PATH=/opt/wkhtmltox/lib /opt/wkhtmltox/bin/wkhtmltopdf

Carsten Rose
committed
To access FE_GROUP protected pages or content, it's necessary to disable the `[FE][lockIP]` check! `wkhtml`
will access the Typo3 page locally (localhost) and that IP address is different from the client (=user) IP.

Carsten Rose
committed
Configure via Typo3 Installtool `All configuration > $TYPO3_CONF_VARS['FE']`: ::
[FE][lockIP] = 0
.. warning::
``[FE][lockIP] = 0`` disables an important anti-'session hijacking' protection. The security level of the whole installation
will be *lowered*! Again, this is only needed if `wkhtml` needs access to FE_GROUP protected pages & content. As an
alternative to lower the security level, create a separated page subtree which is only accessible (configured via
Typoscript) from specific IPs **or** if a FE-User is logged in.

Carsten Rose
committed
If there are problems with converting/downloading FE_GROUP protected pages, check configuration_ `showDebugInfo = download` to debug.

Carsten Rose
committed
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! Verify the correct loading of all elements
by calling the site via a regular browser and bypassing any browser cache (Ctrl F5).
Checklist wkhtml problems
"""""""""""""""""""""""""

Carsten Rose
committed
* `config.baseUrl` is configured and correct. The baseUrl has to be the same protocol as the website (http or https).
* To track down problems:
* In configuration_ set `debug.showDebugInfo=auto,download`.
* Do the download.
* Check QFQ_LOG_ for any output.
* Grab the URL given in the QFQ_LOG_, open a browser in private mode (no existing browser session) and open the URL.
* Check the `--cookie-jar '/tmp/qfq.cookie....'` file for the cookie.
* Call wkhtml manually on the webserver, with the same options as given in the QFQ_LOG_.

Carsten Rose
committed
HTML to PDF conversion

Carsten Rose
committed
""""""""""""""""""""""
`wkhtmltopdf` converts a website (local or remote) to a (multi)-page PDF file. It's mainly used in `download`_.
Print

Carsten Rose
committed
"""""
Different browser prints the same page in different variations. To prevent this, QFQ implements a small PHP wrapper
`print.php` with uses `wkhtmltopdf` to convert HTML to PDF.
Provide a `print this page`-link (replace 'current pageId' )::

Carsten Rose
committed
<a href="typo3conf/ext/qfq/Classes/Api/print.php?id={current pageId}">Print this page</a>

Carsten Rose
committed
Any parameter specified after `print.php` will be delivered to `wkhtmltopdf` as part of the URL.
Typoscript code to implement a print link on every page::
wrap = <a href="typo3conf/ext/qfq/Classes/Api/print.php?id=|&type=99"><span class="glyphicon glyphicon-print" aria-hidden="true"></span> Printview</a>

Carsten Rose
committed

Carsten Rose
committed
Send Email
^^^^^^^^^^
QFQ sends mail via `sendEmail` http://caspian.dotconf.net/menu/Software/SendEmail/ - a small perl script without a central
configuration.

Carsten Rose
committed
By default, `sendEmail` uses the local installed MTA, writes a logfile to `fileadmin/protected/log/mail.log` and handles attachments

Carsten Rose
committed
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').
Nevertheless, on latest system the TLS support is broken - please check sendEmailProblem_.
The Typo3 sendmail eco-system is not used at all by QFQ.
Thumbnail
^^^^^^^^^

Carsten Rose
committed
Thumbnails will be rendered via ImageMagick (https://www.imagemagick.org/) 'convert' and 'inkscape' (https://inkscape.org).
'inkscape' is only used for '.svg' files.
The Typo3 graphic eco-system is not used at all by QFQ.

Carsten Rose
committed
Usage: `column-thumbnail`_.

Carsten Rose
committed
Setup
-----

Carsten Rose
committed
* If you install the extension by manual download/upload and get an error message
"can't activate extension": rename the downloaded zip file to `qfq.zip` or `qfq_<version>.zip` (e.g. version: 18.12.0).

Carsten Rose
committed
* If the Extension Manager stops after importing: check your memory limit in php.ini.
Loading
Loading full blame...