Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getWpsApplication() fail #29

Open
hellobw2000 opened this issue Apr 25, 2021 · 15 comments
Open

getWpsApplication() fail #29

hellobw2000 opened this issue Apr 25, 2021 · 15 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@hellobw2000
Copy link

hellobw2000 commented Apr 25, 2021

I build wheel on mips64 and install it. It gets err when using getWpsApplication()

part of code is
def openwpsapp(self, visible):
if(self.wpsapp!=None):
return
print("openwpsapp")
hr, wpsrpc = createWpsRpcInstance()
if hr != S_OK:
raise self.ConvertException("Can't create the rpc instance", hr)
hr, self.wpsapp = wpsrpc.getWpsApplication()
if hr != S_OK:
raise self.ConvertException("Can't get the application", hr)

@timxx

@hellobw2000
Copy link
Author

hellobw2000 commented Apr 25, 2021

如图所示,wps已经打开了,但是接口返回错误
wps已经设置为多组件的模式了

wps app open error

wps getapp err
@timxx

@timxx
Copy link
Owner

timxx commented May 1, 2021

没有相应的设备测试,我猜是因为WPS启动的慢,SDK内部超时了(x64环境偶尔也会,暂时无解)

@hellobw2000
Copy link
Author

没有相应的设备测试,我猜是因为WPS启动的慢,SDK内部超时了(x64环境偶尔也会,暂时无解)

如果是超时问题,是不是换种实现方式,用C++直接调wps的库也会有这个问题呢?

@timxx
Copy link
Owner

timxx commented May 12, 2021

没有相应的设备测试,我猜是因为WPS启动的慢,SDK内部超时了(x64环境偶尔也会,暂时无解)

如果是超时问题,是不是换种实现方式,用C++直接调wps的库也会有这个问题呢?

是一样的,你也可以自己测试一下 LoL

@tyjuncai
Copy link

tyjuncai commented May 19, 2021

我也遇到这个问题,是我在docker容器内跑,启动Xvfb作为虚拟Xserver,在宿主机内ssh连过去执行命令跑通了,在docker内就报这个错。后面排查应该是在docker容器下跑不会弹框接受EULA导致,不知道这种要怎么解?

@xlg-go
Copy link

xlg-go commented Jan 19, 2022

最终用户协议(EULA)需要勾选上,才行

@Scott-zhangjs
Copy link

这个问题解决了吗 @hellobw2000

@w2918000
Copy link

w2918000 commented Aug 9, 2022

  @hellobw2000 请问怎么解决的,我的EULA设置为true依然有这个问题

@verydemo
Copy link

verydemo commented Oct 31, 2022

@hellobw2000 哥们, 这个解决了么, getWpsApplication() fail.
我用得无界面服务器测试的,EULA 不知道怎么弄。
@timxx
image

@1180100406
Copy link

同问,也是getWpsApplication()失败,hresult为-2147483640,getWpsApplication()返回值为None

@timxx timxx added enhancement New feature or request help wanted Extra attention is needed labels May 2, 2023
@DiclZYY
Copy link

DiclZYY commented May 27, 2023

我也遇到这个问题,是我在docker容器内跑,启动Xvfb作为虚拟Xserver,在宿主机内ssh连过去执行命令跑通了,在docker内就报这个错。后面排查应该是在docker容器下跑不会弹框接受EULA导致,不知道这种要怎么解?

如果没有图形界面,可以在启动用户的配置文件(~/.config/Kingsoft/Office.conf)中添加如下内容:
common\AcceptedEULA=true

@zhuangziyi
Copy link

@hellobw2000 哥们, 这个解决了么, getWpsApplication() fail. 我用得无界面服务器测试的,EULA 不知道怎么弄。 @timxx image

你好,这个问题解决了嘛?

@zhuangziyi
Copy link

同问,也是getWpsApplication()失败,hresult为-2147483640,getWpsApplication()返回值为None

这个问题解决了嘛?我也遇到了同样的问题

@akkuman
Copy link

akkuman commented Aug 2, 2023

@zhuangziyi @1180100406 我折腾测试了一下,封装了一个 Docker 镜像,相关的折腾过程可见 https://hacktech.cn/2023/08/02/2023-08-02-docker-%E4%B8%AD%E4%BD%BF%E7%94%A8-pywpsrpc/

docker 镜像可见 https://github.com/akkuman/headless-wps

@ZhijuCen
Copy link

今天安装了 WPS for Linux 2019,版本号为 11.1.0.11719,环境是带 GUI 的 WSL2 Ubuntu 22.04,为了转换文档格式使用本库。
同样出现了 getWpsApplication() 返回 None,刚刚解决。
关于该函数成功调用的条件,个人认为是需要成功进入文档编辑界面而不被弹窗/警告,这些弹窗都会使主界面的操作受阻。
而我今天安装好启动 wps 的过程,遇到了三个弹窗/警告:1. EULA,2. 数学符号字体缺失,3. 无法打开用于创建文档的空白模板。

  1. EULA,点击接受或见

我也遇到这个问题,是我在docker容器内跑,启动Xvfb作为虚拟Xserver,在宿主机内ssh连过去执行命令跑通了,在docker内就报这个错。后面排查应该是在docker容器下跑不会弹框接受EULA导致,不知道这种要怎么解?

如果没有图形界面,可以在启动用户的配置文件(~/.config/Kingsoft/Office.conf)中添加如下内容: common\AcceptedEULA=true

  1. 数学公式字体缺失,请查阅并用以下 Repo:
    https://github.com/iykrichie/wps-office-19-missing-fonts-on-Linux

  2. 无法打开用于创建文档的模板
    ~/.local/share 不知为何出现了名为 Kingsoft,指向 /Kingsoft 的连接,WPS试图读取模板时读到不存在的目录。我不确定这是否只是我这边存在的问题。

screenshot 2024-03-22 173320

移除这个连接,之后 WPS 会在编辑文本时创建 Kingsoft 目录。

rm ~/.local/share/Kingsoft

综上所述,要使 getWpsApplication() 成功调用,要保证手动打开程序,进入编辑界面时不受阻。希望可帮上忙。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests