在mac上方便地转换word文件到pdf

平时转换文件时,我们都需要用word软件打开文件再去转换,操作步骤太多啦!如何永久使得右键文件就可以转换格式呢?

操作方法

  • 01

    打开软件“自动操作”(mac自带软件)

  • 02

    新建——>服务,选取。

  • 03

    更改框起来的部分。 1. “服务”收到选定的【文件或文件夹】位于【访达】 2. 在左侧搜索框搜索对应操作拖到右侧,先【获得指定的访达项目】,然后【运行shell脚本】 3. 更改shell脚本的传递输入【作为自变量】 4. 添加对应的脚本代码如下: for f in “$@” do # Get the full file PATH without the extension filepathWithoutExtension=”${f%.*}” # Convert the DOCX to HTML, which cupsfilter knows how to turn into a PDF textutil -convert html -output “$filepathWithoutExtension.html” “$f” # Convert the file into a PDF cupsfilter “$filepathWithoutExtension.html” > “$filepathWithoutExtension.pdf” # Remove the temporary HTML file, leaving only the PDF rm “$filepathWithoutExtension.html” >/dev/null # Remove the original file # rm “$f” > /dev/null done 有一点基础的同学应该都看的懂,脚本是将作为输入的文件先转换为可以打印PDF的html格式,再转换为pdf,最后删除掉html格式的文件。因此只要是可以正确转换html格式并且编码格式正确的文件,都可以通过它转为pdf,十分方便啦~ 如果 转为pdf后默认不想要原word文件,则删除倒数第二行的注释,即删掉“#”号,只保留rm “$f” > /dev/null。

  • 04

    command+s快捷键保存,命名为Convert to PDF。 完成! 现在可以打开你的访达,右键各种文本文件在服务中找到转换操作试一下啦~

excel列字母变数字了怎么办(excel列变成数字了怎么变成字母)
« 上一篇 2024-09-07 08:38
邮件存储在哪?怎么更改邮件存放位置
下一篇 » 2024-09-07 08:38