Premium support for our pure JavaScript UI components


Post by tristan »

good morning,

I've been trying for some time to set up PDF export on the scheduler pro.

To do this, I've added the following to my scheduler:

pdfExport: {
                exportServer: 'http://xxx:8080'
            }, 

as well as the server-side installation, using the following command in the node js console:

cd bryntum server/ && npm i && node ./src/server.js -h 8080 -r /bryntum server/resources

Result:

up to date, audited 404 packages in 3s

22 packages are looking for funding
  run `npm fund` for details

12 vulnerabilities (4 moderate, 8 high)

To address issues that do not require attention, run:
  npm audit fix

To address all issues possible, run:
  npm audit fix --force

Some issues need review, and may require choosing
a different dependency.

Run `npm audit` for details.
Access-Control-Allow-Origin: *
(node:6828) [DEP0128] DeprecationWarning: Invalid 'main' field in 'C:\bryntum server\node_modules\node-getopt\package.json' of './lib'. Please either fix that or report it to the module author
(Use `node --trace-deprecation ...` to show where the warning was created)
Http server started on port 8080

When I launch the export by connecting to my app from my server, everything works.
But if I run the export from outside, I get a result with no layout:

Can you tell me where I'm making a mistake?

Thanks for your help.


Post by marcio »

Hey tristan,

What do you mean by "export from outside"? Calling from an app on a cloud server? Do you see any errors or messages inside the console? Are you using a demo code or a custom project? If it's a custom one, could you provide a sample project with your configuration for us to check? We have some guidelines that you can check here https://www.bryntum.com/forum/viewtopic.php?f=1&t=772

Best regards,
Márcio


Post by tristan »

good morning,

I mean that if I launch the export by connecting locally to my server it works.
But remotely from another computer it exports the PDF but without formatting.

This is what I get:

Thursday 8th June 2023
Friday 9th June 2023
Saturday 10th June 2023
sunday june 11th 2023
Monday 12th June 2023 Tuesday 13th June 2023 Wednesday 14th June 2023
Thursday June 15th
2023
11
12
13
14
15
16
17
18
19
6
7
8
9

I've integrated the code into a personal project, but I use the export module provided.

I'm using a very simple code just for the test:

window.Monscheduler = new SchedulerPro({

appendTo: 'cible_scheduler',
startDate: new Date(),
endDate: new Date(Date.now() + 7 * 24 * 60 * 60 * 1000), // 7 days


minHeight : '10em',
flex      : '1 1 50%',


//gestion des dates
DateHelper: {
	weekStartDay: 1
}, //premier jour de la semaine est un lundi


eventStore: MoneventStore,
resourceStore: MonresourceStore,

 



features : {
	filterBar  : true,


	pdfExport : {
            exportServer: 'http://xxx:8080',
           
        }
        },


   
   tbar : [
        '->',
		{
			ref  : 'exportButton',
			type : 'button',
			icon : 'b-fa-file-export',
			text : 'Export',
			onClick() {
				Monscheduler.features.pdfExport.showExportDialog();
			}
		}
    ]  



});

Thank you.


Post by Maxim Gorkovsky »

Hello. I see you're running export server with -r flag. Meaining you should probably configure feature too:

pdfExport: {
  exportServer: 'http://foo.bar',
  translateURLsToAbsolute: 'http://foo.bar/resources/'
}

If you're doing so, you should make sure all your resources are available.

You can find more information here: https://github.com/bryntum/pdf-export-server/blob/main/docs/architecture.md#local-web-server-remote-pdf-export-server


Post by tristan »

this doesn't work either, I get the same result


Post by Maxim Gorkovsky »

It may, if paths on the export server do not match expected values. Please check out troubleshooting guide, it will help you to find a problem: https://github.com/bryntum/pdf-export-server/blob/main/docs/troubleshooting.md


Post Reply