Premium support for our pure JavaScript UI components


Post by clovisapp »

Hi there.

We are currently trying to implement PDF exports with the Gantt into production and we are hitting several issues.

  • Lack of documentation: There are really few documents about how to use the exportPdf feature. Especially for the "server" side of the thing, I've found a .zip somewhere in the forum by digging up which is 2 years old. No commits history, very little intel about what's going on into the code.
  • Installation: I've tried to run the server by building the Dockerfile included into the .zip, then ran a:
    docker run -p 8083:8081 -p 8081:8080 bryntum-export-image
    

When doing so, any requests sent to 'https://localhost:8081' will always get me the same result from the server code:

{
	"success": false,
	"msg": "Failed to export task",
	"stack": "Error: Failed to export task\n    at Queue.onJobFailed (/home/pptruser/src/queue.js:277:28)\n    at Queue.emit (events.js:198:13)\n    at worker.run.then.catch.e (/home/pptruser/src/queue.js:393:24)\n    at process._tickCallback (internal/process/next_tick.js:68:7)"
}
  • Scalability: When deploying on could infrastructure, the way the server code is made make it impossible to deploy on something else than an "ever running server", only to handle a few requests of exports once every few hours. I'm wondering why this hasn't been implemented in a more "fire and forget" style (like an AWS-lambda would handle it) eg: https://github.com/JupiterOne/playwright-aws-lambda

  • Code quality: As I mentioned earlier the server code is 2 years old, so are the dependencies in it, for instance the docker image is build on a base of node 10 which is no longer maintained by node https://nodejs.org/en/about/releases/ .

Is there any plan on your roadmap to improve this feature implementation ? Do you have more documentation ressources somewhere that I missed who would be more up to date ?


Post by Maxim Gorkovsky »

Hello.
We created a public repo for the export server and updated guides: https://github.com/bryntum/pdf-export-server We'd love to hear your feedback


Post by clovisapp »

Hi Maxim,

Thank's for your response and the repo, it will allow us to have a much better overview of what's going on with the server source code.

Still got the issue with the use of it inside the provided Dockerfile. As soon as the code run inside the docker container, either in production (in a EC2), or locally, we get the error I mentioned above ("Error: Failed to export task\n at Queue.onJobFailed ...") all the time.


Post by Maxim Gorkovsky »

We'd need to check what log says. Please enable verbose logging, try to export and then check the log inside the docker container as described here: https://github.com/bryntum/pdf-export-server/blob/main/docs/docker.md#accessing-log


Post by Maxim Gorkovsky »

I've update docker image to bump node version and install missing packages. Please clone repo to local filesystem and try building docker image from it.


Post by clovisapp »

Hi back Maxim.

Does the last Bryntum update can fix our problem of pdf export with Bryntum ?
Is there a way to include an image inside this PDF from the server = manipulate the pdf before sending it to the frontend ?

Thanks a lot for your help

https://www.bryntum.com/blog/whats-new-in-5-2-0/
https://bryntum.com/examples/gantt/export/


Post by Maxim Gorkovsky »

Hello.
It has been a few months already, are you still experiencing problem with onJobFailed exception? That one can be related to puppeteer in docker image missing some libraries. We have published working image to the docker hub, please check it out: https://hub.docker.com/repository/docker/bryntum/pdf-export-server (last update in July)
Alternatively, you can try building new image from the sources in the repo: https://github.com/bryntum/pdf-export-server/blob/main/Dockerfile Docker image was updated to include all required libraries.

Does the last Bryntum update can fix our problem of pdf export with Bryntum ?

Bryntum grid/scheduler/gantt releases only include client-side changes of the export feature. Server-side code is maintained in the separate repo (link above). There were changes related to the export process to speed up generating pages on the client, but server side was not updated for few months already.

Is there a way to include an image inside this PDF from the server = manipulate the pdf before sending it to the frontend ?

Sure, server receives plain HTML and can modify it before passing to puppeteer. You need to process HTML before it gets passed to the queue: https://github.com/bryntum/pdf-export-server/blob/main/src/server/ExportServer.js#L136 Feel free to fork the repo and make changes


Post by clovisapp »

Thanks @Maxim

1- Do you have a crash test example for a PDF export of Gantt ? With thousands of tasks, placed on 5 years range for example
2- Do you plan to also provide scheduler PDF export ?

Thanks a lot


Post by Maxim Gorkovsky »

1- Do you have a crash test example for a PDF export of Gantt ? With thousands of tasks, placed on 5 years range for example

We have some tests for larger datasets, but not of that magnitude. 6 months' worth of tasks on a week preset, 500 tasks overall. Do you have any problems exporting large datasets?

2- Do you plan to also provide scheduler PDF export ?

Scheduler and Grid already support PDF export


Post Reply