Skip to content

Commit 1ff40b7

Browse files
committed
Remove header+footer legacy archive
1 parent c717d2b commit 1ff40b7

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

legacy-archive/server/src/pdf/PdfGenerator.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,14 @@ export class PdfGenerator {
120120

121121
const widthActual = width >= MIN_WIDTH_PX ? width : DEFAULT_WIDTH_PX;
122122

123+
// Remove header and footer in print
124+
const htmlWithoutHeaderAndFooter = html.replaceAll(
125+
/(<header([^;]*)<\/header>|<footer([^;]*)<\/footer>)/g,
126+
''
127+
);
128+
123129
// Ensures assets with relative urls are loaded from the correct origin
124-
const htmlWithBase = html.replace(
130+
const htmlWithBase = htmlWithoutHeaderAndFooter.replace(
125131
'<head>',
126132
`<head><base href="${process.env.APP_ORIGIN_INTERNAL}"/>`
127133
);

xp-archive/server/src/services/PdfService.ts

+1
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ export class PdfService {
130130
try {
131131
const page = await this.browser.newPage();
132132

133+
// Remove header and footer in print
133134
const htmlWithoutHeaderAndFooter = html.replaceAll(
134135
/(<header([^;]*)<\/header>|<footer([^;]*)<\/footer>)/g,
135136
''

0 commit comments

Comments
 (0)