From 4a189f82b2e297f556f7d4e0d39169e80e866d45 Mon Sep 17 00:00:00 2001 From: Rodrigo Martins Date: Tue, 22 Apr 2025 15:16:40 -0300 Subject: [PATCH] tenta fix pdfservice.js --- src/server/services/PdfService.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/server/services/PdfService.ts b/src/server/services/PdfService.ts index 6cbd530..206a59d 100644 --- a/src/server/services/PdfService.ts +++ b/src/server/services/PdfService.ts @@ -45,6 +45,10 @@ export class PdfService { const timbradoUrl = config.timbradoUrl ? `${process.env.FRONTEND_URL || 'http://localhost:5000'}${config.timbradoUrl}` : ''; + // Adiciona log para debug + if (timbradoUrl) { + console.log('[PDF] Timbrado inserido no HTML:', timbradoUrl); + } return ` @@ -71,7 +75,17 @@ export class PdfService { body { position: relative; min-height: 100vh; + /* Remove background-image do body para evitar problemas no Puppeteer */ + } + .timbrado-bg { + position: fixed; + top: 0; + left: 0; + width: 100vw; + height: 100vh; + z-index: 0; ${timbradoUrl ? `background-image: url('${timbradoUrl}'); background-size: cover; background-position: center; background-repeat: no-repeat;` : ''} + pointer-events: none; } .content { position: relative; @@ -80,6 +94,7 @@ export class PdfService { + ${timbradoUrl ? '
' : ''}
${content}