Gantt PDF export - production server issues

Support for v6.x of our Scheduling components


Post Reply
User avatar
harrald
Posts: 29
Joined: Tue May 01, 2018 10:59 am

Gantt PDF export - production server issues

Post by harrald »

On the production server i have got issues with the export to pdf.
export to png works flawless and in development i have got it pdf export working to.
production
production
Screenshot 2018-11-07 at 16.35.14.png (19.28 KiB) Viewed 522 times
development
development
Screenshot 2018-11-07 at 16.35.40.png (70.43 KiB) Viewed 522 times
I have got the same OS (ubuntu 18), and installed the same list of packages needed to make the export work.

Is there a way for me to debug where this might go wrong? Maybe a log or something? Right now it seems like a black box.

User avatar
Terence
Core Developer
Core Developer
Posts: 1523
Joined: Tue Apr 01, 2014 2:23 pm

Re: Gantt PDF export - production server issues

Post by Terence »

Did you built the server executable on the development machine? You could try to build it on the production machine.
But building is not needed. You can run the server script as nodejs app.

Like as described in the readme

Code: Select all

The server can by executed as a node script:

    cd ./server
    node src/server.js -w 8080
But my guess, seeing the picture, is that your production machine has some problems loading the css and image files. The css files used in your app needs to be accessible by puppeteer which is embedded in the export server, else you will get this blank result.

In case that is not doable it is also possible to set a relative path in the export server to the css files.

You will find a section in the readme how to handle this with the -r flag

Code: Select all

When sending HTML fragments to the server, the server launches puppeteer and tries to generate PDF-files based on the provided input. In case the CSS stylesheets are not accessible to the server (for example the resources are protected by a login session), you can make use of the built in web-server to serve resources.

In this case configure the export plugin with: `translateURLsToAbsolute : 'http://server-ip:8081/resources'`. This tells the export plugin to change all the used stylesheet URLs to be fetched from `http://server-ip:8081/resources/....`. This command defines the resources folder location:

    ./server -r '/web/application/resources'

Post Reply