PDF比较在linux命令行 [英] PDF compare on linux command line

查看:122
本文介绍了PDF比较在linux命令行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一个Linux命令行工具来比较两个PDF文件,并将差异保存到PDF outfile。该工具应在批处理过程中创建diff-pdf。 PDF文件是施工计划,因此纯文本比较不起作用。

I'm looking for a Linux command line tool to compare two PDF files and save the diffs to a PDF outfile. The tool should create diff-pdf's in a batch-process. The PDF files are construction plans, so pure text-compare doesn't work.

类似:

<tool> file1.pdf file2.pdf -o diff-out.pdf

我发现的大多数工具

还欢迎任何其他解决方案。

Any other solution is also welcome.

推荐答案

使用(全能)imagemagick和pdftk在两行中完成:

Done in 2 lines with (the allmighty) imagemagick and pdftk:

compare -verbose -debug coder $PDF_1 $PDF_2 -compose src $OUT_FILE.tmp
pdftk $OUT_FILE.tmp background $PDF_1 output $OUT_FILE

选项-verbose和-debug是可选的。

The options -verbose and -debug are optional.


  • compare会将diff作为红色像素

  • pdftk将diff-pdf与背景PDF_1合并

这篇关于PDF比较在linux命令行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆