|
@@ -283,6 +283,17 @@ const sizeOf = require("image-size");
|
|
|
*/
|
|
|
export async function mergePdfListReduce(pdfList,convertOpts){
|
|
|
console.log("pdfList",pdfList)
|
|
|
+ // 所有非PDF转PDF
|
|
|
+ for (let index = 0; index < pdfList.length; index++) {
|
|
|
+ let file = pdfList[index];
|
|
|
+ if(file?.toLocaleLowerCase()?.indexOf("pdf")==-1){
|
|
|
+ convertOpts.files = [file];
|
|
|
+ let pdfBuffer = await LibreOffice.convert(convertOpts);
|
|
|
+ fs.writeFileSync(file+".pdf",pdfBuffer)
|
|
|
+ pdfList[index] = file+".pdf"
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
let mergeList = []
|
|
|
let plist = []
|
|
|
let length = pdfList.length
|