pywpsrpc icon indicating copy to clipboard operation
pywpsrpc copied to clipboard

ARM64平台转换PDF报-2147417851

Open stanleylo110 opened this issue 1 year ago • 1 comments

环境: 操作系统:Linux 8de9f6009222 4.18.0-193.28.1.el7.aarch64 WPS:11.8.2.11929.JK.preload.sw_arm64 python:3.9.21 blinker 1.9.0 click 8.1.8 et_xmlfile 2.0.0 Flask 3.1.0 itsdangerous 2.2.0 Jinja2 3.1.6 MarkupSafe 3.0.2 openpyxl 3.1.5 pywpsrpc 2.3.9 Werkzeug 3.1.3 wheel 0.45.1 zipp 3.21.0

def convert_file(file, docs, format): hr, doc = docs.Open(file, ReadOnly=True) if hr != S_OK: return hr out_dir = os.path.dirname(os.path.realpath(file)) + "/out" os.makedirs(out_dir, exist_ok=True) # you have to handle if the new_file already exists new_file = out_dir + "/" + os.path.splitext(os.path.basename(file))[0] + "." + format ret = doc.SaveAs2(new_file, FileFormat=formats[format]) print(ret) doc.Close(wpsapi.wdDoNotSaveChanges) return ret

返回 ret 值为 -2147417851,转换失败

报下面的错误

文档转换完成[e1827085-dcaf-4e6f-8cf6-9c6e74ff822a.doc] 输出文档路径[/tmp/out/e1827085-dcaf-4e6f-8cf6-9c6e74ff822a.pdf] 文档转换时发生错误 Traceback (most recent call last): File "/wps2pdf/converter.py", line 153, in do_convert return send_from_directory(app.config['UPLOAD_FOLDER'] + '/out', convert_file_name, as_attachment=True) File "/usr/local/lib/python3.9/site-packages/flask/helpers.py", line 565, in send_from_directory return werkzeug.utils.send_from_directory( # type: ignore[return-value] File "/usr/local/lib/python3.9/site-packages/werkzeug/utils.py", line 575, in send_from_directory raise NotFound() werkzeug.exceptions.NotFound: 404 Not Found: The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.

stanleylo110 avatar Mar 28 '25 07:03 stanleylo110

没有arm环境,你可以先确认一下wps依赖那些齐全没有,eula接受没有,另外目前官方也只支持多组件模式

timxx avatar Mar 28 '25 08:03 timxx