From a208caec5577d98d2d82c89366db78ecd1cf454d Mon Sep 17 00:00:00 2001 From: Rodrigo Martins Date: Tue, 22 Apr 2025 10:47:12 -0300 Subject: [PATCH] tenta fix pdfservice.js --- src/server/services/PdfService.ts | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/server/services/PdfService.ts b/src/server/services/PdfService.ts index 11ab877..57491de 100644 --- a/src/server/services/PdfService.ts +++ b/src/server/services/PdfService.ts @@ -423,7 +423,7 @@ export class PdfService { if (remaining.startsWith('') || remaining.startsWith('')) { // Adiciona o texto acumulado antes da tag if (currentChunk) { - formattedChunks.push({ text: currentChunk, isItalic, isBold }); + formattedChunks.push({ text: currentChunk, isItalic: inItalic, isBold: inBold }); currentChunk = ''; } @@ -433,7 +433,7 @@ export class PdfService { else if (remaining.startsWith('') || remaining.startsWith('')) { // Adiciona o texto acumulado em negrito if (currentChunk) { - formattedChunks.push({ text: currentChunk, isItalic, isBold: true }); + formattedChunks.push({ text: currentChunk, isItalic: inItalic, isBold: true }); currentChunk = ''; } @@ -443,7 +443,7 @@ export class PdfService { else if (remaining.startsWith('') || remaining.startsWith('')) { // Adiciona o texto acumulado antes da tag if (currentChunk) { - formattedChunks.push({ text: currentChunk, isItalic, isBold }); + formattedChunks.push({ text: currentChunk, isItalic: inItalic, isBold: inBold }); currentChunk = ''; } @@ -453,7 +453,7 @@ export class PdfService { else if (remaining.startsWith('') || remaining.startsWith('')) { // Adiciona o texto acumulado em itálico if (currentChunk) { - formattedChunks.push({ text: currentChunk, isItalic: true, isBold }); + formattedChunks.push({ text: currentChunk, isItalic: true, isBold: inBold }); currentChunk = ''; } @@ -463,7 +463,7 @@ export class PdfService { else if (remaining.startsWith('
') || remaining.startsWith('
') || remaining.startsWith('
')) { // Adiciona o texto acumulado e então adiciona uma quebra de linha if (currentChunk) { - formattedChunks.push({ text: currentChunk, isItalic, isBold }); + formattedChunks.push({ text: currentChunk, isItalic: inItalic, isBold: inBold }); currentChunk = ''; } @@ -479,10 +479,9 @@ export class PdfService { // Adiciona qualquer texto restante if (currentChunk) { - formattedChunks.push({ text: currentChunk, isItalic, isBold }); + formattedChunks.push({ text: currentChunk, isItalic: inItalic, isBold: inBold }); } - // Agora temos o texto dividido em chunks com formatação let lines: { chunks: { text: string, isItalic: boolean, isBold: boolean }[], width: number }[] = [{ chunks: [], width: 0 }]; let currentLineIndex = 0;