timxx / pywpsrpc

Python bindings for WPS Office RPC (for Linux)
MIT License
219 stars 44 forks source link

无法改变写入图片的宽高, InlineShape.Width = width提示 对象无效属性: 'tuple' object has no attribute 'Width' #93

Closed Teccivil closed 1 month ago

Teccivil commented 1 month ago

前面连接代码省略,以下是我在指定段落添加图片的代码(parag是我获取的指定段落的Range):

img = parag.InlineShapes.AddPicture(img_path) img.Width = width img.Height = height

timxx commented 1 month ago

默认返回的是tuple,第一个是HRESULT

timxx commented 1 month ago

可以包装一下去掉这个,参考https://github.com/timxx/pywpsrpc/wiki/RpcProxy

Teccivil commented 1 month ago

可以包装一下去掉这个,参考https://github.com/timxx/pywpsrpc/wiki/RpcProxy

谢谢大佬,通过这个方式解决了