softdinlibreriajs 12.0.29 → 12.0.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/GenerarPDF.js +9 -2
package/package.json
CHANGED
package/src/GenerarPDF.js
CHANGED
|
@@ -9,7 +9,7 @@ export const generarCertificadoLaboral = (logo, employeeName, companyName, jobTi
|
|
|
9
9
|
const docDefinition = {
|
|
10
10
|
header: {
|
|
11
11
|
columns: [
|
|
12
|
-
{ image:
|
|
12
|
+
{ image: null, width: 100 }, // Logo en base64 o URL
|
|
13
13
|
{
|
|
14
14
|
text: companyName,
|
|
15
15
|
alignment: 'center',
|
|
@@ -60,6 +60,13 @@ export const generarCertificadoLaboral = (logo, employeeName, companyName, jobTi
|
|
|
60
60
|
};
|
|
61
61
|
|
|
62
62
|
// Generar el PDF
|
|
63
|
-
pdfMake.createPdf(docDefinition).
|
|
63
|
+
pdfMake.createPdf(docDefinition).getDataUrl((dataUrl) => {
|
|
64
|
+
const iframeContainer = document.getElementById('iframeContainer');
|
|
65
|
+
if (iframeContainer) {
|
|
66
|
+
iframeContainer.src = dataUrl;
|
|
67
|
+
} else {
|
|
68
|
+
console.error('Element with id "iframeContainer" not found.');
|
|
69
|
+
}
|
|
70
|
+
});
|
|
64
71
|
};
|
|
65
72
|
|