PDF拆分

244 阅读1分钟

1. 在mac上安装ghostscript

JUNE 12, 2022AMBER JAIN

About the App

  • App name: ghostscript
  • App description: Interpreter for PostScript and PDF
  • App websitewww.ghostscript.com/

Install the App

  1. Press Command+Space and type Terminal and press enter/return key.

  2. Copy and paste the following command in Terminal app:
    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
    and press enter/return key. Wait for the command to finish. If you are prompted to enter a password, please type your Mac user's login password and press ENTER. Mind you, as you type your password, it won't be visible on your Terminal (for security reasons), but rest assured it will work.

  3. Now, copy/paste and run this command to make brew command available inside the Terminal: echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile

  4. Copy and paste the following command:
    brew install ghostscript

    gs --version # 成功则输出版本号

Done! You can now use ghostscript.

Related Posts:

2. 拆分pdf

gs -sDEVICE=pdfwrite -dNOPAUSE -dQUIET -dBATCH -dFirstPage=1 -dLastPage=250 -sOutputFile=output.pdf input.pdf

执行上述命令后,会生成一个名为“output.pdf”的PDF文件,其中包含了“input.pdf”文件中从第1页到第250页的内容

3. ghostscript功能不止于此