I'm trying to setup PDF exports now. For my export server I'm using the url https://gantt.st8ging.conslog.com, which is HTTPS. It works and starts exporting the PDF but then it crashes and I see this error on the console:
We don't have assets that require external loading, so most likely it is an external library that causes that error to happen, you can try to have a piece of deeper information debugging the server using the instructions provided here https://github.com/bryntum/pdf-export-server/blob/main/docs/troubleshooting.md.
We'll need to know which file/asset is being tried to be loaded via HTTP.
async processExportContent(response, config) {
const me = this;
if (response.ok && me.openAfterExport) {
// Clone Response to not block response stream
response = response.clone();
const contentType = response.headers.get('content-type');
if (contentType.match(/application\/octet-stream/)) {
const MIMEType = FileMIMEType[config.fileFormat],
objectURL = await me.responseBlobToObjectURL(response, MIMEType),
link = me.getDownloadLink(config.fileName, objectURL);
link.click();
} else if (contentType.match(/application\/json/)) {
const responseJSON = await response.json();
if (responseJSON.success) {
const link = me.getDownloadLink(config.fileName, responseJSON.url);
link.click();
} else {
Toast.show({
html: responseJSON.msg,
rootElement: this.rootElement
});
}
}
}
}
Even though the server url is specified as 'https://gantt.st8ging.conslog.com' here in this code the responseJSON.url uses http instead of https. When I add in the following I stop getting Mixed Content errors:
if (responseJSON.url.startsWith('http://')) {
responseJSON.url = responseJSON.url.replace('http://', 'https://');
}
Why is the responseJSON.url not useing https like it should? Since the server url uses https.
No, you're not supposed to use http://localhost:8080 as a default server location.
Could you please share what your PDF export config looks like? We need that information to understand why they're trying to use http instead of https in the request.
That worked, nice. Now the last issue we're seeing is that the final PDF does export and download, but no styling is applied on it. It's just text. What could be causing this?
Where are those "resources" located? On the Gantt download I see a resources directory. Is that the folder I should move to my server and point to when starting the pdf server?