oat-sa / extension-tao-booklet
An extension for TAO to create test booklets (publishable in MS-Word and PDF along with Answer Sheets)
Installs: 12 153
Dependents: 0
Suggesters: 0
Security: 0
Stars: 6
Watchers: 50
Forks: 4
Open Issues: 1
Type:tao-extension
Requires
- jurosh/pdf-merge: ^2.0
- mikehaertl/phpwkhtmltopdf: ^2.4
- oat-sa/extension-tao-delivery: >=15.0.0
- oat-sa/extension-tao-delivery-rdf: >=14.0.0
- oat-sa/extension-tao-outcome: >=13.0.0
- oat-sa/extension-tao-outcomeui: >=10.0.0
- oat-sa/extension-tao-qtiprint: >=3.2.0
- oat-sa/extension-tao-test: >=15.0.0
- oat-sa/generis: >=14.0.0
- oat-sa/oatbox-extension-installer: ~1.1||dev-master
- oat-sa/tao-core: >=50.26.0
- tecnickcom/tcpdf: ^6.2
- dev-master
- v4.4.2
- v4.4.1
- v4.4.0
- v4.3.1
- v4.3.0
- v4.2.1
- v4.2.0
- v4.1.1
- v4.1.0
- v4.0.1
- v4.0.0
- v3.7.4
- v3.7.3
- v3.7.2
- v3.7.1
- v3.7.0
- v3.6.0
- v3.5.0
- v3.4.2
- v3.4.0
- v3.3.0
- v3.2.1
- v3.1.0
- v3.0.2
- v3.0.1
- v2.1.2
- v2.1.0
- v2.0.0
- v1.14.3
- v1.14.2
- v1.14.1
- v1.14.0
- v1.13.1
- v1.13.0
- v1.12.0
- v1.10.1
- v1.10.0
- v1.9.3
- v1.9.2
- v1.9.1
- v1.9.0
- v1.6.0
- v1.5.1
- v1.4.3
- v1.4.2
- v1.4.1
- v1.4.0
- v1.3.0
- v1.2.1
- v1.2.0
- v1.1.0
- v1.0.0
- v0.4.0
- dev-develop
- dev-feature/sonarqube-integration
- dev-feature/AUT-3277/logo_url_and_path
- dev-fix/update-autoRelease-action-with-bot-user
- dev-release-4.3.1
- dev-hotfix/AUT-2995/add-brazilian-portuguese-language
- dev-feature/AUT-3065
- dev-release-4.2.2
- dev-feat/adf-245-add-taoBooklet-to-geneis-search-whitelist
- dev-release-2.1.2
- dev-remove-jenkinsfile
- dev-fix/NEC-81/uninformativeErrorWhenSaveBookletWithoutRequireParams
- dev-fix/NCC-152/AssignmentsReportKeepsTracksOfAssignment
- dev-fix/INV-78/undownloadable-booklets
- dev-TDR-2/fix-code-styling
- dev-fix/TAO-4144-cover-page-qr-code
- dev-release-1.9.2
- dev-fix/TAO-4808/paper-test-pdf-configuration
- dev-feature/TAO-4793-booklet-multiple-deliveries
- dev-test-preview
- dev-print-service
- dev-test-runner
This package is auto-updated.
Last update: 2024-11-15 16:45:49 UTC
README
An extension for TAO to create test booklets (publishable in MS-Word and PDF along with Answer Sheets)
Warning
Due to the move to ES2015
, some code might not work on legacy browsers.
Especially for code that use to rely on polyfills, like for the Promise
.
The polyfills are now linked only when the code is bundled, and are not reachable anymore in development mode.
For that reason, and because wkhtmltopdf
is not supporting ES2015 and requires polyfills,
the generation of PDF only works with bundled version (aka production mode).
From version 4.2.0
of taoBooklet
, the page rendered to get the PDF will always use bundles transpiled to ES5. This applies no matter if the mode is set to development or production.
This implies that any change made to the source code will need to pass trough a re-bundling:
cd tao/views/build
npx grunt taobookletbundle
For version 4.1.1
and older, you still need to activate the production mode as follows:
- open the config file
config/generis.conf.php
, and set the constantDEBUG_MODE
tofalse
(around line 50):
#mode define('DEBUG_MODE', false);
Configuration
The file config/taoBooklet/wkhtmltopdf.conf.php
contains entries for setting up the tool:
'binary'
- The path to the installed binary, usually/usr/local/bin/wkhtmltopdf
.'options'
- A set of option for controlling the rendering. See below.
wkhtmltopdf options
Note: additional options supported by wkhtmltopdf can be added here too. For a complete list, see: https://wkhtmltopdf.org/usage/wkhtmltopdf.txt
Requirements
This extension needs a third-party tool to generate the PDF files.
So to be able to generate the booklet, you should install wkhtmltopdf
on your server.
If you are using Ubuntu you can use these commands:
sudo apt-get update
sudo apt-get install wkhtmltopdf
However, depending on the version of your system, the installed version of wkhtmltopdf
may
not fully comply with the requirements, as there is some issues with QT when trying to render
header and footers. If you encounter errors when generating the document, you should install
the tool using these commands:
wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.jessie_amd64.deb
sudo dpkg -i wkhtmltox_0.12.5-1.jessie_amd64.deb
After that you can use /usr/local/bin/wkhtmltopdf
in your configuration
For Debian-based distributions, you may need to do an additional step to install some dependencies:
sudo apt-get update
sudo apt-get install wkhtmltopdf
sudo apt-get install libxrender1 fontconfig xvfb
sudo apt --fix-broken-install
If the previous steps fail, you may try to use a binary, non-packaged distribution instead.
wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
tar xf wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
cd ./wkhtmltox/bin/
sudo cp -R ./* /usr/bin/
sudo cp -R ./* /usr/local/bin/
wkhtmltopdf -V
Please refer to https://wkhtmltopdf.org/downloads.html for an updated list of
wkhtmltopdf
packages for Ubuntu and other distributions. You may find a list of
source, binary and packages for v0.12.5 at GitHub as well.
Deprecated: Please note that the version 0.12.4 has a bug which was fixed in the version 0.12.5: sometimes footers and headers not provided in the pdf
sudo apt-get update
sudo apt-get install libxrender1 fontconfig xvfb
wget https://downloads.wkhtmltopdf.org/0.12/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz -P /tmp/
cd /usr/share/
sudo tar xf /tmp/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
sudo rm /usr/bin/wkhtmltopdf
sudo ln -s /usr/share/wkhtmltox/bin/wkhtmltopdf /usr/bin/wkhtmltopdf