tenta fix pdfservice.js

This commit is contained in:
rodrigo committed 2025-04-22 15:16:40 -03:00
1 parent f1f1ee4826
commit 4a189f82b2
1 file changed
+15
+15
View File
@@ -45,6 +45,10 @@ export class PdfService {
const timbradoUrl = config.timbradoUrl const timbradoUrl = config.timbradoUrl
? `${process.env.FRONTEND_URL || 'http://localhost:5000'}${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 ` return `
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
@@ -71,7 +75,17 @@ export class PdfService {
body { body {
position: relative; position: relative;
min-height: 100vh; 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;` : ''} ${timbradoUrl ? `background-image: url('${timbradoUrl}'); background-size: cover; background-position: center; background-repeat: no-repeat;` : ''}
pointer-events: none;
} }
.content { .content {
position: relative; position: relative;
@@ -80,6 +94,7 @@ export class PdfService {
</style> </style>
</head> </head>
<body> <body>
${timbradoUrl ? '<div class="timbrado-bg"></div>' : ''}
<div class="content"> <div class="content">
${content} ${content}
</div> </div>