Skip to content

Commit

Permalink
feat: set printBackground to true
Browse files Browse the repository at this point in the history
  • Loading branch information
ChiefORZ committed Jun 7, 2023
1 parent 72c3cf8 commit 8195081
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import type { Server } from 'http';
import path from 'path';
import { PDFDocument } from 'pdf-lib';
import PCR from 'puppeteer-chromium-resolver';
import type { PaperFormat } from 'puppeteer-core';
import type { PaperFormat, PDFOptions } from 'puppeteer-core';
import puppeteer from 'puppeteer-core';
import report from 'puppeteer-report';
import util from 'util';
Expand All @@ -22,14 +22,15 @@ const debug = Debug('pdf-generator');

const writeFileAsync = util.promisify(fs.writeFile);

const pdfOptions = {
const pdfOptions: PDFOptions = {
format: 'a4' as PaperFormat,
margin: {
top: 0,
bottom: 0,
left: 0,
right: 0,
},
printBackground: true,
};

const createExpressServer = (
Expand Down

0 comments on commit 8195081

Please sign in to comment.