Xiaopei's DokuWiki

These are the good times in your life,
so put on a smile and it'll be alright

User Tools

Site Tools


it:pdf

pdf

命令行处理 pdf

用 pdftk:https://stackoverflow.com/questions/32505951/pdftk-server-on-os-x-10-11

安装包:https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/pdftk_server-2.02-mac_osx-10.11-setup.pkg

$ pdftk pdfkit\ test.pdf dump_data | grep NumberOfPages
NumberOfPages: 2
 
$ pdftk mydocument.pdf cat 1-20 22-end output newdocument.pdf

html 转 pdf / html2pdf / wkhtmltopdf

用 wkhtmltopdf

转换格式

Ghostscript can be used as a raster image processor (RIP) for raster computer printers—for instance, as an input filter of line printer daemon—or as the RIP engine behind PostScript and PDF viewers. Ghostscript can also be used as a file format converter, such as PostScript to PDF converter.

用 gm 等工具将 pdf 转为 jpg 需先安装 ghostscript

windows 上通过命令行批量打印 pdf 的工具

  • 打印时很可能要修改缩放程度、黑白/彩色、单页/多页等,但很多工具、库经测试无法使用打印机驱动中的配置项,本身也没有配置项
  • 但 PDFtoPrinter 能使用另一个可视化工具 PDF-Xchange Viewer 导出的配置(因为这个命令行工具本身就是 Xchange 的包装),先可视化配置、测试,再导出使用命令行批量操作
it/pdf.txt · Last modified: 2019/05/14 11:15 by admin