你好,我正在尝试将Png图像转换为Svg。在我的windows计算机上,我可以用以下代码转换png:
import aspose.words as aw
doc = aw.Document()
builder = aw.DocumentBuilder(doc)
shape = builder.insert_image("negative.png")
shape.image_data.save("Output.svg")
但是现在我在popOs中,它给出了这样的错误:
No usable version of libssl was found
Aborted (core dumped)
我尝试更新openssl并安装libssl。有什么办法解决这个问题吗?
发布于 2022-07-19 06:12:23
实际上,您使用的代码不会将PNG转换为SVG。ImageData.Save
方法将图像保存为原始格式,因此Output.svg
文件将只是一个扩展名为SVG的PNG文件。如果需要将PNG包装到SVG,可以使用ShapeRenderer
。
doc = aw.Document()
builder = aw.DocumentBuilder(doc)
shape = builder.insert_image("C:\\Temp\\in.png")
shape.get_shape_renderer().save("C:\\Temp\\out.svg", aw.saving.ImageSaveOptions(aw.SaveFormat.SVG))
另外,请看Linux系统对Aspose.Words的需求。您应该在您的系统中安装libsll
。例如,下面是Ubuntu坞配置:
FROM ubuntu:22.04
RUN apt update \
&& apt install -y python3.10 python3-pip libgdiplus wget \
&& wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1l-1ubuntu1_amd64.deb \
&& dpkg -i ./libssl1.1_1.1.1l-1ubuntu1_amd64.deb \
&& rm -i libssl1.1_1.1.1l-1ubuntu1_amd64.deb \
&& python3.10 -m pip install unittest-xml-reporting==3.2.0
ENTRYPOINT ["/usr/bin/python3.10"]
https://stackoverflow.com/questions/73017833
复制相似问题