File tree 2 files changed +8
-1
lines changed
legacy-archive/server/src/pdf
xp-archive/server/src/services
2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -120,8 +120,14 @@ export class PdfGenerator {
120
120
121
121
const widthActual = width >= MIN_WIDTH_PX ? width : DEFAULT_WIDTH_PX ;
122
122
123
+ // Remove header and footer in print
124
+ const htmlWithoutHeaderAndFooter = html . replaceAll (
125
+ / ( < h e a d e r ( [ ^ ; ] * ) < \/ h e a d e r > | < f o o t e r ( [ ^ ; ] * ) < \/ f o o t e r > ) / g,
126
+ ''
127
+ ) ;
128
+
123
129
// Ensures assets with relative urls are loaded from the correct origin
124
- const htmlWithBase = html . replace (
130
+ const htmlWithBase = htmlWithoutHeaderAndFooter . replace (
125
131
'<head>' ,
126
132
`<head><base href="${ process . env . APP_ORIGIN_INTERNAL } "/>`
127
133
) ;
Original file line number Diff line number Diff line change @@ -130,6 +130,7 @@ export class PdfService {
130
130
try {
131
131
const page = await this . browser . newPage ( ) ;
132
132
133
+ // Remove header and footer in print
133
134
const htmlWithoutHeaderAndFooter = html . replaceAll (
134
135
/ ( < h e a d e r ( [ ^ ; ] * ) < \/ h e a d e r > | < f o o t e r ( [ ^ ; ] * ) < \/ f o o t e r > ) / g,
135
136
''
You can’t perform that action at this time.
0 commit comments