最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
Mac 使用 Microsoft Word 批量将 DOCX 转 PDF 并保持原排版
时间:2026-07-17 10:28:49 编辑:袖梨 来源:一聚教程网
Mac 使用 Microsoft Word 批量将 DOCX 转 PDF(保持原排版)
之前尝试过使用 WPS 和 LibreOffice 批量转换 DOCX 为 PDF,但发现导出的 PDF 存在页边距变大、上下留白增加、分页错乱等问题。
如果 Mac 已安装 Microsoft Word,可以直接通过 AppleScript 调用 Word 导出 PDF,生成效果与 Word 手动导出基本一致。
单个文件转换
osascript <<'EOF'tell application "Microsoft Word"open POSIX file "/Users/mac/Downloads/1/1.docx"set d to active documentsave as d file name "/Users/mac/Downloads/1/1.pdf" file format format PDFclose d saving noend tellEOF
批量转换整个目录
例如需要转换:
/Users/mac/Downloads/1
目录下所有 .docx 文件:
DIR="/Users/mac/Downloads/1"for f in "$DIR"/*.docx; do[ -f "$f" ] || continuepdf="${f%.docx}.pdf"osascript <<EOFtell application "Microsoft Word"open POSIX file "$f"set d to active documentsave as d file name "$pdf" file format format PDFclose d saving noend tellEOFecho "Converted: $(basename "$f")"done
转换后:
1.docx->1.pdf2.docx->2.pdf3.docx->3.pdf
PDF 会保存在原文件所在目录。
适用场景
- 合同
- 标书
- 论文
- 公司模板
- 对 PDF 排版一致性要求较高的文档
相比 WPS、LibreOffice 转换,直接调用 Microsoft Word 导出的 PDF 更能保持原始排版。
相关文章
- 隐藏输入的 TTF 字体:伪装字体 07-17
- 使用“经典”机器学习(AIGC文本检测)检测 LLM- Gened Web 虚构 07-17
- zlibrary最新地址下载-老用户私藏的稳进路线从此告别404 07-17
- 《巨神军师》赵云和吕布对比分析介绍 07-17
- 六便士与月亮-是啥梗 07-17
- 《失控进化》所有模式介绍 07-17