|
@@ -200,7 +200,7 @@ async function downloadUrl(url,options) {
|
|
|
files.push({ data: docxBuffer, ext: "docx" })
|
|
|
}
|
|
|
files = [...files,...filePathList]
|
|
|
-
|
|
|
+ // console.log("files",files)
|
|
|
let convertOpts = {
|
|
|
files,
|
|
|
properties: {
|
|
@@ -252,8 +252,13 @@ async function downloadUrl(url,options) {
|
|
|
}
|
|
|
|
|
|
// 方式2:先合并pdf,后合并docx
|
|
|
- if(files?.length>4){
|
|
|
- let pdfList = [mainPdfPath,...files.slice(1)];
|
|
|
+ if(files?.length>=2){
|
|
|
+ // console.log(files)
|
|
|
+ let tmpFiles = files
|
|
|
+ if(docxPath){
|
|
|
+ tmpFiles = files.slice(1) // 携带首个docx时,从第二个开始
|
|
|
+ }
|
|
|
+ let pdfList = [mainPdfPath,...tmpFiles];
|
|
|
pdfList = pdfList.filter(item=>item)
|
|
|
let mergedFileList = await mergePdfListReduce(pdfList,convertOpts)
|
|
|
pdfPath = mergedFileList[0];
|