I have tried to implement the Export Pdf feature with the Vue js. The pdf file is imported successfully but I have facing issues related to the designing part.
Hello.
Exporting might be tricky with Vue development environment. We have a special demo showing how to do it: Gantt/examples/frameworks/vue/pdf-export
pdfExportFeature: {
exportServer: 'https://localhost:8080',
// Development config
translateURLsToAbsolute: 'https://localhost:8081',
clientURL: 'https://localhost:8081',
// For production replace with this one. See README.md for explanation
// translateURLsToAbsolute : 'https://localhost:8080/resources/', // Trailing slash is important
keepPathName: false
}
For production env different settings are required.
Regarding size of the exported content, that might be related to the fact that we set a fixed size to the exported content. Best way to overcome this would be to pick smaller paper size, like A5.
I have read the loading resources chapter, but little bit confused about the resource path.
I have currently using the laravel+vue package and place the bryntum-grid package under the resource/js folder. I have copied the assets from the bryntum-grid package from the path (bryntum-grid/) (https://prnt.sc/115pgnr) and paste them under the path (bryntum-grid/examples/_shared/server) (https://prnt.sc/115pfsk) and trying to download the pdf.
The pdf is downloaded fine but the CSS and font awesome are not included in the pdf file.
The command which i have run is below
cd examples/_shared/server/ && npm i && node ./src/server.js -h 8080 -r resources
FontAwesome icons not loading mean that export server couldn't load font. Font is either missing from the path or load is blocked by CORS, which happens often. And it is unlikely resources config would help to fix vue app in development mode - vue dev server has own path to host resources. In this case clientURL comes in handy, which I didn't see you've configured.
Easiest way to tell what goes wrong is to check network tab, copy HTML sent to the server, put it to the local file and open in browser. There should be errors in console.