<tabs> <tab label="plugin.cms:RIBBON_TABS_TAB_CONTENT_EDIT_LABEL" id="org.ametys.cms.content.EditionTab" contextualColor="1" contextualGroup="Z" contextualLabel="plugin.cms:RIBBON_TABS_TAB_CONTENT_EDIT_LABEL"> <groups> [...] <group label="plugin.cms:RIBBON_TABS_TAB_CONTENT_EDIT_GROUPS_GROUP_INSERT_LABEL" icon=""> <large> [...] </large> <medium> [...] <control id="org.ametys.flipbook.editor.Insert"/> </medium> <small> [...] </small> </group> [...] </groups> <tab> [...] </tabs>
Attention ! Si le groupe contient une description <large>, <medium> et <small> , il faut ajouter le bouton dans les 3.
Displaying a PDF file involves two phases: the pages of the PDF file are extracted as PNG images, then the viewer displays them.
As the generation of pages as images is an extension point, several options are available for this operation:
Extraction motor | Extension name | Operating systems | Extraction quality |
---|---|---|---|
Bookstore java Apache PDFBox | org.ametys.plugins.flipbook.convertor.Pdfbox | All | good |
External command-line program | org.ametys.plugins.flipbook.convertor.CommandLine | Linux and MacOS only | very good |
The choice of image generation engine is made in the "" configuration file.
This is the default solution because it's the easiest to implement: there's no external program to install, the library is already supplied with CMS and works with all operating systems. However, the quality of extracted images is not as good as when using an external program.
To use it, simply leave the "WEB-INF/param/runtime.xml" file empty for the extension point. "org.ametys.plugins.flipbook.Document2ImagesConvertor" (or use the org.ametys.plugins.flipbook.convertor.Pdfbox).
The solution can work with any command-line program that extracts pages from a PDF file as numbered PNG images. This section describes how to use the pdftoppm program.
This solution has the advantage of quality: the extracted images are perfectly in line with the original PDF document. However, it requires the installation of an external program, and cannot be used in a Windows environment.
To use this solution, enter the following line in your application's"WEB-INF/param/runtime.xml " file
<org.ametys.plugins.flipbook.Document2ImagesConvertor>org.ametys.plugins.flipbook.convertor.CommandLine</org.ametys.plugins.flipbook.Document2ImagesConvertor>
This solution is preferable if the environment permits.
You then need to install the program that makes the pdftoppm command available. The most widely used is Poppler.
To install this program under Debian/Ubuntu :
$ sudo apt-get install poppler-utils
Using an external command line program requires a configuration parameter corresponding to the conversion command: see the Administration Manual.