How to Remove a PDF Signature (that disallows any document changes)

PDF documents may be secured by an initial signature/certificate for disallowing any changes. This is not to be confused with “password security” or “certificate security”.

I am speaking of the kind of restrictions you will get with “Menu>File>Save as Certified Document” and then selecting “Disallow any changes to the document” (which also implies “Lock the certifying signature so that it can’t be cleared or deleted by anyone”).

This action produces a document which you cannot modify (e.g. add bookmarks or comments), and you also cannot remove the restricting signature. No PDF password remover will help you here, since there is no password!

But I found out that you can do – quite simply – disable the restrictions and render the signature removable, i.e. after these changes, you can manually delete it with Adobe Acrobat Professional:

With the Perl scripting language, this hack is applied with the following script

# Usage: perl invalidate-signing-certs.pl <in.pdf >out.pdf
binmode(STDIN);
binmode(STDOUT);
$/ = "\0";
while(<>) {
  s#(/Perms<</DocMDP.*?>>)#' ' x length $1#ge;
  s#(/Ff 1)(?=.*?/Lock )#' ' x length $1#ge;
  s#(?<=/Lock)(.*?)(/Ff 1)#"$1" . ' ' x length $2#ge;
  s#(/Lock .*?)(?=/)#' ' x length $1#ge;
  print $_;
}

The next time you open the modified document with Acrobat you will still see the signature field. Just click on it with your right mouse button and from the menu popup select “Clear Signature Field”, then “Delete Signature Field”. Now safe it and everything is fine – no more restrictions. (Tip: Use “Save as” to clean up the document of any hidden signature objects.)

Note: Always make a backup of your PDF document before modifying it, since sometimes the hacks just don’t work and you end up with a document that Acrobat cannot repair.

Update August 2006: The procedure of unsigning is now available as a video(AVI, 2,4 mb). Or watch it at Youtube.com. It shows how to unsign a ebook (in PDF 1.6 format) with the batch script using Acrobat 7.0.

Update October 2006: I’ve updated the example code. The earlier version had problems due to platform-dependent handling of line endings. The current script version operates in binary mode and is tested under Window (ActiveState and Cygwin) and Mac OS X.

Download

The archive pdf-scripts.zip contains the script shown above, and some other useful scipts:

  • invalidate-signing-certs.pl: Invalidates all Signing Certificates, thus removing any restrictions imposed by them.
  • bookmarks-fitpage.pl: Change Bookmark display style to “Fit Page”.
  • bookmarks-close.pl: Close opened Bookmark Folders.
  • bookmarks-close-1.5.pl: Close opened Bookmark Folders (for documents in PDF version 1.0-1.5, i.e. Acrobat up to 6.x)
使用方法:这是perl  script,需要有perl执行程序,使用shell或者cmd,输入"perl invalidate-signing-certs.pl <in.pdf >out.pdf"。
注意:上面的<和>都是需要的。<输入的pdf >输出的pdf。
转载自:点击打开链接
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值