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