fix pdf generation

remotes/1693055039339581669/master
Igor Laborie 5 years ago
parent c1f11faedc
commit 128653dd1b
  1. 2
      .gitignore
  2. BIN
      static/schedule/schedule.pdf
  3. 7
      tools/pdf.js

2
.gitignore vendored

@ -5,3 +5,5 @@ node_modules/
.idea/
.vscode/
yarn-error.log
static/schedule/schedule*.pdf

Binary file not shown.

@ -9,6 +9,7 @@ Logger.config.defaultLevel = LogLevel.Debug;
const logger = Logger.getLogger('pdf');
// Configuration
const output = 'static/schedule/schedule.pdf';
const serverConf = {
port: 8765,
options: {
@ -93,13 +94,11 @@ async function cleanupBeforePrint(page) {
logger.debug("done", pageResponse.statusText());
await cleanupBeforePrint(page);
logger.info('export pdf');
const path = 'static/schedule/schedule.pdf';
logger.info('export pdf', output);
const format = 'A3';
const scale = .4;
const printBackground = true;
await page.pdf({path, format, scale, printBackground});
await page.pdf({path:output, format, scale, printBackground});
logger.debug("pdf done");
} catch (e) {

Loading…
Cancel
Save