test-export.js 4.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. const Parse = require("parse/node");
  2. Parse.initialize("edu-textbook");
  3. Parse.serverURL = "http://8.140.98.43/parse";
  4. global.Parse = Parse;
  5. import path from "path";
  6. import { mergePdfListReduce } from "../../../lib/docs";
  7. /**
  8. *
  9. (npx vite build) -and (node temp/test-export.js)
  10. npx vite build && node temp/test-export.js
  11. npx vite build
  12. node temp/test-export.js
  13. @desc 本地合成测试指令
  14. sudo apt install poppler-utils
  15. libreoffice --headless --convert-to pdf *.jpg
  16. pdfunite 1*.pdf final.pdf
  17. libreoffice 更多用法可以在终端输入 libreoffice --help 或者 man libreoffice 。
  18. */
  19. import { exportProcessReportDocs } from "../func-tbook-export";
  20. async function main(){
  21. try{
  22. console.log("测试合集")
  23. // console.log(await exportProcessReportDocs("FR7KZtefyR"))
  24. // console.log("测试列表")
  25. // console.log(await exportProcessReportDocs(null,["9V575dapEM"]))
  26. // console.log(await exportProcessReportDocs(null,["c2WUE5PgCo"]))
  27. // console.log(await exportProcessReportDocs(null,["R9r0XtMsK3"])) // CIP顺序问题,后两个pdf到了最前面
  28. // console.log(await exportProcessReportDocs(null,["MU5YpUizfW"]))
  29. // console.log(await exportProcessReportDocs(null,["UUGgHPHsIC"]))
  30. // console.log(await exportProcessReportDocs(null,["KxhErArSbB"]))
  31. // console.log(await exportProcessReportDocs(null,["7cf69rSawD"]))
  32. // console.log(await exportProcessReportDocs(null,["kY6MbE1JXC"])) // 21个附件,超时
  33. // console.log(await exportProcessReportDocs(null,["O8kCxqdasp"])) // \u0002 乱码
  34. // console.log(await exportProcessReportDocs(null,["VK81UnQmkn"]))
  35. // console.log(await exportProcessReportDocs(null,["SD0NCAdscz"]))
  36. // console.log(await exportProcessReportDocs(null,["sbVgvo4qEk"]))
  37. // console.log(await exportProcessReportDocs(null,["4LnH46Mu03"]))
  38. // console.log(await exportProcessReportDocs(null,["xdIAG8BYnX"]))
  39. // console.log(await exportProcessReportDocs(null,["NJ2hWa17gi"]))
  40. // console.log(await exportProcessReportDocs(null,["tnEfUnTaQU"])) // C/C++ pathname error
  41. // console.log(await exportProcessReportDocs(null,["2s353GQBjk"]))
  42. // console.log(await exportProcessReportDocs(null,["KvvN9lWhri"]))
  43. // console.log(await exportProcessReportDocs(null,["orBBW42ZCn"])) // rar attach
  44. // console.log(await exportProcessReportDocs(null,["UwPtEptZTR"])) // pdf 七 八 加密
  45. // console.log(await exportProcessReportDocs(null,["TsjBrECA4m"])) // pdf 加密
  46. // console.log(await exportProcessReportDocs(null,["z7yhFusOns"]))
  47. // console.log(await exportProcessReportDocs(null,["ybzJWkXqQG"]))
  48. // console.log(await exportProcessReportDocs(null,["4UAwQ4nc5A"]))
  49. console.log(await exportProcessReportDocs(null,["ybzJWkXqQG"]))
  50. // console.log(await exportProcessReportDocs(null,["3wJSkW9HNV"]))
  51. // console.log(await exportProcessReportDocs(null,["tHhfIDBkhf"]))
  52. // console.log(await exportProcessReportDocs(null,["cgTEtIvkK4"]))
  53. // console.log(await exportProcessReportDocs(null,["KvvN9lWhri"]))
  54. // console.log(await exportProcessReportDocs(null,["F8eiOAfuC3"]))
  55. // console.log(await exportProcessReportDocs(null,["Oa1yB6n64u","j4pt2MMTXM","jAMGxwrl1F","BwZpEoOtS8","X10kCktA0r"]))
  56. // console.log(await exportProcessReportDocs(null,["BwZpEoOtS8","X10kCktA0r"]))
  57. }catch(err){
  58. console.error(err)
  59. }
  60. }
  61. main()
  62. // mergePdfListReduce([
  63. // path.join("/home/ryan/workspace/nova/edu-textbook/server/cloud/tbook/template/模板-推荐申报表.docx"),
  64. // path.join("/home/ryan/workspace/nova/edu-textbook/server/cloud/tbook/template/模板-推荐申报表.docx")
  65. // ],{
  66. // files: [
  67. // '/home/ryan/workspace/nova/edu-textbook/server/cloud/tbook/test/temp/temp/112_1f15d43c0534288c61089099792e44e7.docx'
  68. // ],
  69. // properties: { pageSize: 'A4', margin: { top: 0, right: 0, bottom: 0, left: 0 } },
  70. // pdfa: false,
  71. // pdfUA: false,
  72. // merge: true
  73. // });