Page 1 of 2

[ANGULAR] scheduler pro implement export to pdf

Posted: Mon Nov 28, 2022 10:34 am
by boyitech

Greetings!


I'm using scheduler pro's PDF export feature.I successfully sent the request and successfully implemented the functionality. But the server configuration is your back-end server. How can we implement this back-end export method if we develop it ourselves and deploy it on our own server.


Re: [ANGULAR] scheduler pro implement export to pdf

Posted: Mon Nov 28, 2022 12:29 pm
by Maxim Gorkovsky

Hello.
If you're looking into implementing the backend, you can check out this repo: https://github.com/bryntum/pdf-export-server/ and do something similar. Protocol is not really described anywhere, but you can infer it easy from code (ignore the queueing part): server receives a JSON with data (html to render + some configs) and returns either JSON with link to the file or the file itself.


Re: [ANGULAR] scheduler pro implement export to pdf

Posted: Tue Nov 29, 2022 8:28 am
by boyitech

Whether the component supports exporting the name of a hidden task

Image


Re: [ANGULAR] scheduler pro implement export to pdf

Posted: Tue Nov 29, 2022 9:01 am
by marcio

Hey boyitech,

It'll export the way it looks on the Scheduler, if you want to export without the name on the task, you'll need to configure the Scheduler to not display the name.


Re: [ANGULAR] scheduler pro implement export to pdf

Posted: Tue Nov 29, 2022 10:56 am
by boyitech

I returned the path to the PDF in the backend, and took this path to successfully open it in the browser, but the frontend prompted that the file could not be downloaded.

I didn't find a way to listen for export PDF requests, and I couldn't get the return value of the backend, and the component's built-in download method indicates that there are no files to download.

Image

Image


Re: [ANGULAR] scheduler pro implement export to pdf

Posted: Tue Nov 29, 2022 11:09 am
by boyitech

The exported PDF does not seem to support abbreviation of tree components, and the overflow text will overlap with other columns

Image


Re: [ANGULAR] scheduler pro implement export to pdf

Posted: Tue Nov 29, 2022 12:18 pm
by marcio

Hey, regarding the overflow and support abbreviation, could you please provide a sample of data for us to test and use to investigate the problem??


Re: [ANGULAR] scheduler pro implement export to pdf

Posted: Tue Nov 29, 2022 12:19 pm
by marcio

Also, related to the download, the link provided by the server should be used as a reference in the JS frontend to download, but you need to get that done on the code, you can try some of these approaches https://itnext.io/how-to-download-files-with-javascript-d5a69b749896


Re: [ANGULAR] scheduler pro implement export to pdf

Posted: Wed Nov 30, 2022 5:12 am
by boyitech

It seems that the backend address accessed is directly configured in the settings, how can I listen to the request I sent and get the return value.

The problem I'm currently having is that the backend can return the download path correctly, but the frontend can't get it manually, the sending of this request is encapsulated in the brytumn component, and I can't listen to this request.

Image


Re: [ANGULAR] scheduler pro implement export to pdf

Posted: Wed Nov 30, 2022 1:31 pm
by marcio

I see, perhaps you could use another approach, you can set https://bryntum.com/products/gantt/docs/api/Grid/feature/export/PdfExport#config-sendAsBinary to true, and from there you'll get the PDF binary itself instead of the server link to download.