我想自动将一个大的 PDF 文档分成两个文件:一个文件应该只包含黑白内容的页面,另一个应该只包含任何颜色内容的页面。彩色和黑白页面不连续运行——它们散布在整个文档中。我怎样才能自动执行此操作?
Chris Rodgers编写了一个 Perl 脚本,将 PDF 文件拆分为彩色页面和黑白页面。这是脚本的链接:pdfcolor-1.2.tgz。
\n\n网站上对该脚本如何工作的详细说明:
\n\n- Perl script\n- uses:\n\xe2\x80\x93 \xe2\x80\x9cpscolor\xe2\x80\x9d (C, \xe2\x80\x9cusing GS DLL as a ps colorpage separator\xe2\x80\x9d) by Carsten Hammer\n\xe2\x80\x93 \xe2\x80\x9cjoinPDF\xe2\x80\x9d (Java, \xe2\x80\x9cCommand line tool to join and split PDF files\xe2\x80\x9d, for mac) by Gerard Briscoe\n- Has hardcoded paths in shell scripts \xe2\x80\x9csplitPDF\xe2\x80\x9d and \xe2\x80\x9cjoinPDF\xe2\x80\x9d\n- Depends on flex\n- Depends on libgs-dev\n- GNU GPL 2.0\n\nHow it works:\nsplit PDF into single pages in temporary location\nuse pscolor to detect whether color is on the page\nreassemble pages with color and pages without color into two pdf files.\n\nDoes not work when adjusting said hardcoded paths.\n
Run Code Online (Sandbox Code Playgroud)\n