doc2pdf
XiaO / 2021-09-29
doc2docx
在 Terminal 中,使用 textutil 将 doc 文件 file.doc 转换为 docx 格式。
textutil -help # 查看 textutil 使用帮助
textutil -convert docx file.doc
docx2pdf
brew install pandoc # 格式转换工具
brew install --cask basictex # PDF 生成引擎
pandoc --help # 查看 pandoc 使用帮助
fc-list :lang=zh # 列出系统中的中文字体
pandoc -f docx -o output_file.pdf --pdf-engine=xelatex -V CJKmainfont='Kaiti SC' -V mainfont=Menlo file.docx
- -f FORMAT, -r FORMAT, —from=FORMAT, —read=FORMAT 输入文件格式
- -t FORMAT, -w FORMAT, —to=FORMAT, —write=FORMAT 输出文件格式
- -o 输出文件
- -s, —standalone 增加页眉和页脚。其中,
pdf
、epub
、epub3
、fb2
与docx
格式会默认设置该选项。