tenta fix pdfservice.js
This commit is contained in:
1 parent
41d3963d67
commit
5698266d3e
1 file changed
+16
-1
@@ -28,7 +28,18 @@ export class PdfService {
|
||||
criadoEm: true
|
||||
}
|
||||
});
|
||||
// Retorna configuração padrão se não existir
|
||||
// Extrai recuo de primeira linha se existir em margensTemplate
|
||||
let firstLineIndent = '0mm';
|
||||
if (config?.margensTemplate) {
|
||||
try {
|
||||
const margens = typeof config.margensTemplate === 'string' ? JSON.parse(config.margensTemplate) : config.margensTemplate;
|
||||
if (margens && margens.firstLineIndent) {
|
||||
firstLineIndent = `${margens.firstLineIndent}mm`;
|
||||
}
|
||||
} catch (e) {
|
||||
// Se der erro, ignora e usa padrão
|
||||
}
|
||||
}
|
||||
return {
|
||||
timbradoUrl: config?.timbradoUrl || '',
|
||||
timbradoMarginTop: config?.timbradoMarginTop ?? 100,
|
||||
@@ -36,6 +47,7 @@ export class PdfService {
|
||||
timbradoMarginLeft: config?.timbradoMarginLeft ?? 50,
|
||||
timbradoMarginRight: config?.timbradoMarginRight ?? 50,
|
||||
templatePadrao: config?.templatePadrao || '',
|
||||
firstLineIndent
|
||||
};
|
||||
} catch (error) {
|
||||
console.error('Erro ao buscar configuração:', error);
|
||||
@@ -105,6 +117,9 @@ export class PdfService {
|
||||
break-inside: auto;
|
||||
page-break-inside: auto;
|
||||
}
|
||||
.content p {
|
||||
text-indent: ${config.firstLineIndent || '0mm'};
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
Reference in new issue
Block a user