tenta fix pdfservice.js
This commit is contained in:
1 parent
926a2934e4
commit
5786af03d5
1 file changed
+3
-1
@@ -266,7 +266,9 @@ export class PdfService {
|
|||||||
|
|
||||||
// Função para quebrar texto em linhas respeitando largura máxima
|
// Função para quebrar texto em linhas respeitando largura máxima
|
||||||
function wrapText(text: string, font: any, fontSize: number, maxWidth: number): string[] {
|
function wrapText(text: string, font: any, fontSize: number, maxWidth: number): string[] {
|
||||||
const words = text.split(' ');
|
// Remove quebras de linha internas para evitar erro de encoding
|
||||||
|
const cleanText = text.replace(/\r?\n/g, ' ');
|
||||||
|
const words = cleanText.split(' ');
|
||||||
const lines: string[] = [];
|
const lines: string[] = [];
|
||||||
let currentLine = '';
|
let currentLine = '';
|
||||||
for (const word of words) {
|
for (const word of words) {
|
||||||
|
|||||||
Reference in new issue
Block a user