Thread "PDF-Erstellung, PDF creator Installation oder bug"

Tabs

  • Deleted
    Deleted | 21. Sep 2019, 20:33
    PDF-Erstellung, PDF creator Installation oder bug
    Hallo Ilias-Fans,

    ich habe einen Linux-Server (LTS Ubuntu 18.04.03) und nach Anleitung Ilias 5.4.5 installiert (https://docu.ilias.de/ilias.php?ref_id=367&obj_id=116903&cmd=layout&cmdClass=illmpresentationgui&cmdNode=4o&baseClass=ilLMPresentationGUI). Ich habe die Ersteinrichtung durchlaufen und einen Fragenpool / Test eingerichtet. (ich habe verschiedene Fragetypen angelegt. Im Wesentlichen Single-Choice, Multiple-Choice, Anordnungsfrage horizontal) Nach einem Durchlauf wollte ich das Ergebnis als PDF speichern, allerdings bekomme ich nach einem Klick das PDF zu generieren kein PDF angezeigt.

    Jetzt weiß ich nicht, ob ich die Installation nicht vollständig vorgenommen habe, oder ob es sich um einen Bug handelt. Hat jemand in Version 5.4.5. die Funktion schon erfolgreich getestet, bzw. was muss ich machen um den PDF-creator auf der Linux-Maschine korrekt zu installieren?

    vielen Dank für die Unterstützung vorweg

    eClicker
  • Qndrs
    Robert Kuunders | Qndrs | 22. Sep 2019, 21:01
    Re: PDF-Erstellung, PDF creator Installation oder bug
    Did you install Ghostscript? Are there errors registered in your logfile?

    Robert
  • Deleted
    Deleted | 23. Sep 2019, 00:00
    Edited on: 23. Sep 2019, 00:01 - by Deleted
    Re (2): PDF-Erstellung, PDF creator Installation oder bug
    Hi Robert,

    thank you for your advise to try installing ghostscript but I assume this won't fix my problem . As explained in the installation guide phantomjs is necessary for PDF-creation. I have recently checked ilias.log and I found this:

     ilPhantomJSRenderer::createPDFFileFromHTMLFile:329 ilPhantomJSRenderer command line config:  /opt/apache2/ilias/data/LANCOM/temp/tmp5d87eb20b2bfd.html /opt/apache2/ilias/data/mandant/temp/tmp5d87eb20b30c9.pdf "{\"page_size\":\"A4\",\"orientation\":\"Portrait\",\"margin\":\"1cm\",\"delay\":200,\"viewport\":\"\",\"header\":null,\"footer\":null,\"page_type\":0}"
    [3ujd8] [2019-09-22 23:44:01.203981] mandant_root.INFO: ilPhantomJSRenderer::createPDFFileFromHTMLFile:329 ilPhantomJSRenderer error: Array
    (
    )

    Does this indicate a bug or what might cause the array error? Shall I create a bug report?

    thank you in advance.

    eClicker
  • rbaumgartner
    rbaumgartner | rbaumgartner | 23. Sep 2019, 09:20
    Re: Re (2): PDF-Erstellung, PDF creator Installation oder bug
    Quote (eClicker)
     ilPhantomJSRenderer::createPDFFileFromHTMLFile:329 ilPhantomJSRenderer command line config:  /opt/apache2/ilias/data/LANCOM/temp/tmp5d87eb20b2bfd.html /opt/apache2/ilias/data/mandant/temp/tmp5d87eb20b30c9.pdf "{\"page_size\":\"A4\",\"orientation\":\"Portrait\",\"margin\":\"1cm\",\"delay\":200,\"viewport\":\"\",\"header\":null,\"footer\":null,\"page_type\":0}"
    [3ujd8] [2019-09-22 23:44:01.203981] mandant_root.INFO: ilPhantomJSRenderer::createPDFFileFromHTMLFile:329 ilPhantomJSRenderer error: Array
    (
    )


    Does this indicate a bug or what might cause the array error? Shall I create a bug report?

    This confusing error message usually indicates that the phantomjs executable is not found. Have you configured the path to phantomjs (e.g. /usr/local/bin/phantomjs) under Administration -> PDF Generation? The path must be defined for all 4 renderers in the list.

    The default path should already be /usr/local/bin/phantomjs, but the executable may be in a different location on your system.

  • Deleted
    Deleted | 2. Oct 2019, 12:14
    PDF-Generation
    Hi Mr. Baumgartner,

    I recently checked your advice: I have logged in to the linux console of my Ubuntu Server 18.04.03 and checked the result of "whereis phantomjs". This is the output of the command: /usr/bin/phantomjs

    Afterwards I checked the settings of Administration: "content services" -> PDF Generation. In all 4 sections phantomjs is the preferred renderer and also selected in the drop-down menu underneath. When I click "configure renderer" the shown path is identic to the one of the linux console (/usr/bin/phantomjs). The executable is stored in that path and also marked as executable. (-rwxr-xr-x 1 root root 129 Feb 15  2016 /usr/bin/phantomjs*)

    thanks for further ideas.
  • tmueller@databay.de
    tmueller@databay.de | tmueller@databay.de | 2. Oct 2019, 12:38
    Re: PDF-Generation

    Hi eClicker,

    did you check if the phantomjs is headless working?



    regarding to this:

    https://github.com/ariya/phantomjs/issues/14330

    We are determine problems with the distro version of phantomjs.

  • Deleted
    Deleted | 2. Oct 2019, 14:07
    Edited on: 2. Oct 2019, 14:18 - by Deleted
    PDF Erstellung , PDF Generation
    Hi tmueller,

    thanks for your hint. The related report: https://github.com/ariya/phantomjs/issues/14376 offered an working solution. The linked binary:

    https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2

    fixed my issue. After Downloading I replaced the phantomjs binary so PDF generation is working properly now.

    THANKS tmueller,

    perhaps this information may help others also:
    I have found another post advising to try php-tcpdf - RESULT: this does also create PDFs without an error  (but does only work for tests)
  • Deleted
    Deleted | 30. Jun 2020, 17:01
    Re: PDF Erstellung , PDF Generation

    Hi,

    ich habe den gleichen Fehler wie du, und auch Ubuntu 18.04. nur mit Ilias 6. Habe bereits das Phantomjs von Github probiert sowie das von bitbucket wie du vorgeschlagen hast. 

    Hast Du noch einen Tipp?

  • Felix@ITZ
    Felix@ITZ | Felix@ITZ | 30. Jun 2020, 23:16
    PDF Erstellung , PDF Generation // phantomJS

    Hi,

    the TestArchiveCreator plugin by Institut für Lern-Innovation  Friedrich-Alexander-Universität Erlangen-Nürnberg lists some useful advice on using phantomJS with ILIAS for PDF generation. To quote from their README:



    Please look at the PhantomJS web site for general installation instructions. Short hint for Debian based systems (thanks to Rachid Rabah): apt-get install phantomjs PhantomJS will be located in /user/bin/phantomjs Set the following environment variables: export QT_QPA_PLATFORM=offscreen export QT_QPA_FONTDIR=/usr/share/fonts/truetype If you need a font with Japanese characters: apt-get install fonts-takao

    You may also take binary distribution fom https://bitbucket.org/ariya/phantomjs/downloads/

    • PhantomJS 2.1.1 is the preferred one, but renders web fons as graphis which results in large, unsearchable PDFs. You may prevent this by deactivating 'Use System Styles' in the plugin configuration, but this leads to ugly output.

    • PhantomJS 1.9.8 is able to render web fonts, so 'Use System Styles' can be activated. But this older version seems to have some problems with ssl and images, so you should set 'Any SSL Protocoll', 'Ignore SSL Errors', and 'Render Twice" in the plugin configuration.


    We set those env variables in a Docker Entrypoint. If you run on bare metal or VM, make sure these env variables are visible to your web server. There is also a section about the Web Access Checker (in case images are missing from PDFs) and Debugging of the PDF generation. In reading and following their advice, our PDF generation issues been have almost gone.