[ANSWERED] problems with export server (and exporting gantt to pdf in general)

Support for v6.x of our Scheduling components


Post Reply
User avatar
Omega Code
Posts: 20
Joined: Wed Aug 14, 2019 11:27 am

[ANSWERED] problems with export server (and exporting gantt to pdf in general)

Post by Omega Code »

We are using:
Bryntum for Ext JS 6.1.5 PRO and Ext JS 7.0.0.156
with Your new pdf export example (using node.js and hummus)

environment for print server is:
Ubuntu
Python 2.7.17
node@10.18.0
node-pre-gyp@0.14.0
GNU Make 4.1

We encountered multiple issues while trying to make pdf export work.
*i don't know if it would be better to create separate topic for each of those, so for now all our problems are listed below:
**most crucial points are 5. and 6. though

----

1. we weren't able to npm install it on node 12 due to multiple errors such as:

Code: Select all

../src/PDFStreamDriver.cpp:88:28: error: ‘GetNewInstance’ is not a member of ‘ByteWriterDriver’ 
     Handle<Value> result = ByteWriterDriver::GetNewInstance(args);
                            ^
that ended up with following error:

Code: Select all

hummus.target.mk:160: polecenia dla obiektu 'Release/obj.target/hummus/src/PDFStreamDriver.o' nie powiodły się
make: *** [Release/obj.target/hummus/src/PDFStreamDriver.o] Błąd 1
2. we weren't able to build server app on node 10 (but we could at list npm install it and start it later on)

Code: Select all

Create server executables
> pkg@4.3.1
> Targets not specified. Assuming:
  node10-linux-x64, node10-macos-x64, node10-win-x64
> Error! No available node version satisfies 'node10'
3. we also had some problems with ssl certificates for https provided in Your package:

Code: Select all

net::ERR_CERT_AUTHORITY_INVALID
but that we were able to fix ourselves with new certificates

4. then we were finaly able to connect to server but it turned out some libs are missing for us. these were:

Code: Select all

error while loading shared libraries: libXcursor.so.
error while loading shared libraries: libXss.so.1
error while loading shared libraries: libpangocairo-1.0.so.0
error while loading shared libraries: libgtk-3.so.0
5. after installing above libs we finally got our PDF generated from our app but it didnt look like our app at all. see:
- live-app-export.pdf
- live-app-screenshot.png

6. then while preparing testcase for the above we found out that basic example app gets much better pdf - still without any gantt elements visible. see:
- example-app-export.pdf
- example-app-screenshot.png

-----

we attached here working test case example for frontend,
we did not add any modifications to server side example and we use it like: node src/server.js -H 8080
we also attached both requests (example and live) saved from chrome to .har if that may help explaining differences between pdf's
pdf-export-issue.zip
- example app: pdf, screenshot, har
- live app: pdf, screenshot, har
- test case (example app)
(2.58 MiB) Downloaded 16 times
We have a lot of customisation and plugins in use in our live app.
Also we use newer versions of Ext and Bryntum (see above) while example app is using:
- Bryntum: 6.0.8
- Ext JS: 6.5.3

export plugin configration and its button are the same for both live app and example app (attached)

----------

We would like to know why we can't see gantt blocks on pdf even for example app
but our end goal is to have pdf working for our live app.
Is there maybe an option to use previous solution? (php+PhantomJS based)
Or what else can we do about it now?
Can anybody help us with that?

User avatar
Maxim Gorkovsky
Core Developer
Core Developer
Posts: 3075
Joined: Wed Jan 08, 2014 11:46 am

Re: problems with export server (and exporting gantt to pdf in general)

Post by Maxim Gorkovsky »

Hello.
1. we weren't able to npm install it on node 12 due to multiple errors such as:
Hummus binaries are built for node 8.9.4 as stated in the readme. You need to either rebuild binaries or switch node version. Please see HummusJS section for more details.
2. we weren't able to build server app on node 10 (but we could at list npm install it and start it later on)
This looks like pkg issue caused by your local nodejs version. Please refer to this issue for more details: https://github.com/zeit/pkg/issues/415
Probably this issue would be gone when you rebuild hummus or use node 8.9.4
3. we also had some problems with ssl certificates for https provided in Your package:
Included self-signed certificate has expired indeed. I added a ticket about this issue: https://app.assembla.com/spaces/bryntum/tickets/9551-export-server-ssl-certificate-has-expired/details
5. after installing above libs we finally got our PDF generated from our app but it didnt look like our app at all. see:
I checked PDFs, they looks like stylesheets were not loaded properly. Is this result consistent?
Most likely it is related to export server running HTTPS:
node src/server.js -H 8080
Does it work better if you run it with HTTP?

Code: Select all

node src/server.js -h 8080
Is there maybe an option to use previous solution? (php+PhantomJS based)
We switched from PhantomJS partially because it didn't show gantt chart like expected. Using puppeteer is better way to go because we get consistent result, option to debug and support. If you want, you can look for phantomjs export demo in scheduler < 6.0.0.

I can recommend to try newer export server version instead. Download bryntum grid trial, extract and copy new server from `examples/_shared/server`. It has several improvements like:
* newer puppeteer
* parallel workers
* logging
* more options to pass through various resource loading restrictions
* it is tested with node 10
And it has same client-server API.

User avatar
Omega Code
Posts: 20
Joined: Wed Aug 14, 2019 11:27 am

Re: problems with export server (and exporting gantt to pdf in general)

Post by Omega Code »

Thank You for quick response,
We will try with this new server version and older node version and will get back here with results

also we ll check if we get any better results without https (altough we'll need https to work either way)

User avatar
Omega Code
Posts: 20
Joined: Wed Aug 14, 2019 11:27 am

Re: problems with export server (and exporting gantt to pdf in general)

Post by Omega Code »

just to close this thread, answering above suggestions:
- ssl or no made no difference
- grid server version or one we used before made no difference
- only thing we were in fact missing were styles - that werent accessible from export server
+ we still had some problems with missing icons on exported pdf - that we fixed temporarly by adding font-awesome styles to pdf herader

Post Reply