@things-factory/integration-headless 7.0.54 → 7.0.55

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/integration-headless",
3
- "version": "7.0.54",
3
+ "version": "7.0.55",
4
4
  "main": "dist-server/index.js",
5
5
  "things-factory": true,
6
6
  "author": "heartyoh <heartyoh@hatiolab.com>",
@@ -22,12 +22,12 @@
22
22
  "clean": "npm run clean:server"
23
23
  },
24
24
  "dependencies": {
25
- "@things-factory/attachment-base": "^7.0.49",
26
- "@things-factory/board-service": "^7.0.49",
27
- "@things-factory/integration-base": "^7.0.49",
28
- "@things-factory/shell": "^7.0.49",
25
+ "@things-factory/attachment-base": "^7.0.55",
26
+ "@things-factory/board-service": "^7.0.55",
27
+ "@things-factory/integration-base": "^7.0.55",
28
+ "@things-factory/shell": "^7.0.55",
29
29
  "ejs": "^3.1.10",
30
30
  "pdf-lib": "^1.17.1"
31
31
  },
32
- "gitHead": "14a3320fb61bd0a47c147d4c3ff8310de6172f61"
32
+ "gitHead": "20eb64e468407b2044e76d9c7019a837281141ad"
33
33
  }
@@ -14,8 +14,6 @@ async function HeadlessPDFOpen(step, context) {
14
14
 
15
15
  const pdfInfo = {
16
16
  pdfDoc,
17
- header,
18
- footer,
19
17
  watermark,
20
18
  fileName,
21
19
  pageCount: 0
@@ -47,6 +45,8 @@ async function HeadlessPDFOpen(step, context) {
47
45
 
48
46
  pdfInfo.lastPageBuffer = lastPageBuffer
49
47
  pdfInfo.pageCount = pdfDoc.getPageCount()
48
+ pdfInfo.header = header
49
+ pdfInfo.footer = footer
50
50
 
51
51
  return {
52
52
  data: pdfInfo
@@ -210,6 +210,14 @@ export class PDFCaptureUtil {
210
210
  // 페이지에 HTML 콘텐츠를 설정합니다.
211
211
  await page.setContent(htmlContent, { waitUntil: 'networkidle0' })
212
212
 
213
+ // 페이지가 완전히 로드된 후에 워터마크와 머릿글 적용
214
+ const { __headless_pdf } = this.context
215
+ const { header, footer, watermark, landscape } = __headless_pdf
216
+
217
+ if (header || footer || watermark) {
218
+ await this.applyHeaderFooterWatermark(page, { header, footer, watermark, landscape, data: __headless_pdf })
219
+ }
220
+
213
221
  // 페이지 옵션 설정
214
222
  const pageOptions = this.buildPageOptions(stepOptions)
215
223