Bryntum Team:
We are having difficulties generating a pdf in relation to the gray tones even in the example that they have those colors are not appearing when they generate the PDF.
please help because we need solve this issue.
The problem is appearing even in the example that you have in Gantt Kitchen Sink.
https://dev.bryntum.com/examples/gantt/examples/export/
Support Forum
Hi, this issue was already reported. Fix will ship in release 6.0.3
https://app.assembla.com/spaces/bryntum ... icket=6807
If you want a quick workaround, you can adapt the following functions in server.js
and
We recently discovered that this is a known issue with puppeteer loading the resources in the page. It needs to wait until all network activity is idle before generating the file buffer.
https://app.assembla.com/spaces/bryntum ... icket=6807
If you want a quick workaround, you can adapt the following functions in server.js
async function processPageIntoPdfBuffer (browser, html, config) {
config.printBackground = true;
config.margin = {
top : 0,
bottom : 0,
left : 1,
right : 1
};
return new Promise(async (resolve, reject) => {
try {
const page = await browser.newPage();
//best way of loading according to https://github.com/GoogleChrome/puppeteer/issues/728
await page.goto(`data:text/html;charset=UTF-8,${html}`, { waitUntil: 'networkidle0' });
await page.emulateMedia('print');
const buffer = await page.pdf(config);
await page.close();
resolve(buffer);
}
catch (ex) {
reject(ex.message);
}
});
}
async function processPageIntoPngBuffer (browser, html, config) {
return new Promise(async (resolve, reject) => {
try {
const page = await browser.newPage();
await page.goto(`data:text/html;charset=UTF-8,${html}`, { waitUntil: 'networkidle0' });
await page.emulateMedia('print');
const buffer = await page.screenshot(config);
await page.close();
resolve(buffer);
} catch (ex) {
reject(ex.message);
}
});
}