@sme.up/doc-alchemist 1.1.0-SNAPSHOT-20250623155458 → 1.2.0-SNAPSHOT-20250624074547
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.
|
@@ -1,28 +1,4 @@
|
|
|
1
|
-
import { SupportedExportFormats, } from "../types/index.js";
|
|
2
|
-
import { dataTableToExcelData } from "../excel/excel-generator.js";
|
|
3
|
-
import * as libre from "libreoffice-convert";
|
|
4
|
-
import { promisify } from "util";
|
|
5
1
|
export const dataTableToPdfData = async (component, webupManagerData) => {
|
|
6
|
-
|
|
7
|
-
return convertToPdf(excelData);
|
|
8
|
-
};
|
|
9
|
-
export const convertToPdf = async (excelData) => {
|
|
10
|
-
const extend = ".pdf";
|
|
11
|
-
const convertAsync = promisify(libre.convert);
|
|
12
|
-
let buffer;
|
|
13
|
-
if (Buffer.isBuffer(excelData)) {
|
|
14
|
-
buffer = excelData;
|
|
15
|
-
}
|
|
16
|
-
else {
|
|
17
|
-
buffer = Buffer.from(excelData);
|
|
18
|
-
}
|
|
19
|
-
try {
|
|
20
|
-
const pdfBuf = await convertAsync(buffer, extend, undefined);
|
|
21
|
-
return pdfBuf;
|
|
22
|
-
}
|
|
23
|
-
catch (err) {
|
|
24
|
-
console.error("Errore nella conversione in PDF:", err);
|
|
25
|
-
throw err;
|
|
26
|
-
}
|
|
2
|
+
throw new Error("dataTableToPdfData is not implemented");
|
|
27
3
|
};
|
|
28
4
|
//# sourceMappingURL=pdf-generator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pdf-generator.js","sourceRoot":"","sources":["../../../src/pdf/pdf-generator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pdf-generator.js","sourceRoot":"","sources":["../../../src/pdf/pdf-generator.ts"],"names":[],"mappings":"AAKA,MAAM,CAAC,MAAM,kBAAkB,GAAG,KAAK,EACrC,SAGC,EACD,gBAAkC,EACjB,EAAE;IACnB,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;AAC3D,CAAC,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\nimport { SmeupDataTable } from \"@sme.up/kokos-sdk-node\";\nimport { GenericObject, WebupManagerData } from \"../types/index.js\";\nimport { promisify } from \"util\";\n\nexport const dataTableToPdfData = async (\n component: {\n smeupDataTable: SmeupDataTable;\n props: GenericObject;\n },\n webupManagerData: WebupManagerData,\n): Promise<Buffer> => {\n throw new Error(\"dataTableToPdfData is not implemented\");\n};\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sme.up/doc-alchemist",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0-SNAPSHOT-20250624074547",
|
|
4
4
|
"description": "Library for generating documents in various formats, including Excel and PDF.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Smeup LAB <info@smeup.com> (https://www.smeup.com/)",
|
|
@@ -41,7 +41,6 @@
|
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@sme.up/kokos-sdk-node": "^3.0.0-SNAPSHOT",
|
|
44
|
-
"exceljs": "^4.4.0"
|
|
45
|
-
"libreoffice-convert": "^1.6.1"
|
|
44
|
+
"exceljs": "^4.4.0"
|
|
46
45
|
}
|
|
47
46
|
}
|