Reader Extensions, and why they break

Usually on this blog we cover details of things you can do with our PDF API, so it's a bit of a departure to cover something we can't.

Reader Extensions are a feature added to Adobe LiveCycle and Adobe Acrobat (the full version) to allow users with Adobe Acrobat Reader (the free version) to do things they wouldn't normally be able to do. This includes saving the file, submitting the form and so on.

It's quite easy to do with Acrobat - in version 9, select "Extend Features In Acrobat" from the Advanced menu, and from Acrobat X select "File", "Save As", "Reader Extended PDF". This will give you a PDF that you can open in Acrobat Reader with the extended features, namely being able to save the file and so on.

How does this work? Internally, "enabling reader extensions" actually applies a digital signature to the file, similar to the type used when certifying a PDF. It checksums each object in the file and digitally signs the result with a key that is known only by Adobe (who, after all, wouldn't make any money if you could do everything you wanted with their free Reader software).

This document enabled extended features in Adobe Reader. The document has been changed since it was created and use of extended features is no longer available. Please contact the author for the original version of this document

This is why editing the file after Reader Extensions have been applied will cause the above warning - it's telling you the checksum has been altered. Unfortunately there's no way past this for our software, or indeed any PDF software other than Adobe's own. You can be fairly confident that Adobe won't be releasing that signing key any time soon.

Exactly what changes you can make without invalidating this checksum we're not 100% sure, as the algorithm is undocumented. Certainly moving pages around, editing page content, adding or removing fields and other structural changes are disallowed. Setting the value of form fields is allowed, as is signing a PDF in an existing signature field, modifying PDF metadata like author, title, and so on.

So you need to be careful when you're editing a PDF with Reader Extensions with our API. But how do you know they're there? The easiest way is to check the OutputProfile for the ReaderExtensions feature:

PDF pdf = new PDF(new PDFReader(...));
OutputProfile profile = pdf.getBasicOutputProfile();
if (profile.isSet(OutputProfile.Feature.ReaderExtensions)) {
   // Reader extensions are set

So that's Reader Extensions. If you're modying a file that contains them, Caveat editor!