Joe*_*nin 9 pdf microsoft-word macos
假设我在一个文件夹中有几个 Word 文件。有没有办法从这些文件中生成一批 PDF?
One option using the command line would be to use pandoc (which requires LaTeX for PDF generation).
brew install pandoc && brew install --cask basictex textutil: textutil -convert docx *.docexport PATH=/Library/TeX/texbin:"$PATH"pandoc -o myfile.pdf myfile.docx因为您的问题是关于批量转换多个文件,所以您可以轻松地将其放入循环中:
#! /bin/bash
for file in *.doc; do
textutil -convert docx "$file"
# Account for the new `x` in `docx`
pandoc -o "${file%doc}pdf" "${file}x"
done
Run Code Online (Sandbox Code Playgroud)
您可以使用docx2pdf命令行实用程序在 macOS(或 Windows)上将 docx 批量转换为 pdf。它使用 Microsoft Word 的 API 直接转换为 PDF,创建完美的副本。它在 macOS 中使用 JXA(Javscript for Automation,基本上是 JS 中的 AppleScript)和 Windows 中的 win32com。
pip install docx2pdf
docx2pdf myfolder/
Run Code Online (Sandbox Code Playgroud)
免责声明:我在努力寻找跨平台解决方案以零格式将 docx 转换为 pdf 后编写了此工具,因为它直接使用 Microsoft Word。https://github.com/AlJohri/docx2pdf
如果您安装了 MS Word(或任何其他可以打开 MS Word 文件的应用程序),则可以使用 Automator。以下是有关如何根据您的需求进行设置的分步指南:http://aseriesoftubes.com/articles/how-to-batch-convert-doc-files-to-pdf-format-using-mac-osx -自动化装置/
整个过程简要概述:
- 打开自动化器
- 创建新的工作流程
- 从
library左侧面板中,选择Files & Folders然后双击Get Specified Finder Items- 添加所有要转换的文件
library现在从面板中选择Documents,然后双击Convert Format of Word Documents- 从下拉菜单中选择
Portable Document Format (PDF)- 最后,单击
Run按钮,它将转换所有文件并将它们保存在原始Word文件所在的同一文件夹中。
| 归档时间: |
|
| 查看次数: |
37815 次 |
| 最近记录: |