如何在Linux上将pptx文件转换为jpg或png(对于每张幻灯片)?

编程入门 行业动态 更新时间:2024-10-10 17:31:27
本文介绍了如何在Linux上将pptx文件转换为jpg或png(对于每张幻灯片)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我想将PowerPoint演示文稿转换为多张图像.我已经在服务器上安装了LibreOffice,将docx转换为pdf没问题.将pptx转换为pdf无效.我使用以下命令行:

I want to convert a powerpoint presentation to multiple images. I already installed LibreOffice on my server and converting docx to pdf is no problem. pptx to pdf conversion does not work. I used following command line:

libreoffice --headless --convert-to pdf filename.pptx

是否可以立即将pptx转换为png,还是必须先将其转换为pdf,然后再使用ghostscript或其他方式?

Is there es way to convert pptx to pngs immediately or do I have to convert it to pdf first and then use ghostscript or something?

那质量设置呢?有没有办法选择最终图像的分辨率?

And what about the quality settings? Is there a way to choose the resolution of the resulting images?

提前谢谢!

根据此链接,我能够使用简单的命令行将pdf转换为图像:

According to this link I was able to convert a pdf to images with the simple command line:

convert <filename>.pdf <filename>.jpg

(我想您需要LibreOffice和ImageMagick,但不确定-在我的服务器上工作)

(I guess you need LibreOffice and ImageMagick for it but not sure about it - worked on my server)

但是pptx到pdf转换仍然存在问题.

But there are still the problems with the pptx-to-pdf convert.

由于使用了谷歌搜索功能和塞巴斯蒂安·海因(Sebastian Heyn)的帮助,我能够使用此行创建一些高质量图像:

Thanks to googling and Sebastian Heyn's help I was able to create some high quality images with this line:

convert -density 400 my_filename.pdf -resize 2000x1500 my_filename%d.jpg

使用后请耐心等待-您仍然可以在unix控制台中键入soemthing,但正在处理中.只需等待几分钟,即可创建jpg文件.

Please be patient after using it - you still can type soemthing into the unix console but it's processing. Just wait a few minutes and the jpg files will be created.

有关选项的更多信息,请查看此链接

For further information about the options check out this link

P.S.:pptx文件的宽高比似乎不完全是4:3,因为生成的图像尺寸为1950x1500

P.S.: The aspect ratio of a pptx file doesn't seem to be exactly 4:3 because the resulting image size is 1950x1500

推荐答案

在安装unoconv和LibreOffice之后,您可以使用:

After Installing unoconv and LibreOffice you can use:

unoconv --export Quality=100 filename.pptx filename.pdf

可以将您的演示文稿转换为pdf.有关其他选项,请此处.

to convert your presentation to a pdf. For further options look here.

之后,您可以-如上所述-使用:

Afterwards you can - as already said above - use:

convert -density 400 my_filename.pdf -resize 2000x1500 my_filename%d.jpg

接收图像.

更多推荐

如何在Linux上将pptx文件转换为jpg或png(对于每张幻灯片)?

本文发布于:2023-10-31 10:39:39,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1545836.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:幻灯片   上将   转换为   文件   如何在

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!