Avoka Blog: Adobe LiveCycle

November 8, 2008

Creating a Read-only copy of a form

Filed under: Designing Forms, Designing Processes, LiveCycle — htreisman @ 2:27 pm

Overview

Very often, as part of a process, you’ll want to create a read-only copy of a form, and store it somewhere, or email it to someone. There are various ways of achieving this, and they vary in different ways.

Making the fields read-only

It’s possible to make all the fields in the form read-only, using some Javascript coding. This is fairly straight forward, and looks something like:

TextField1.access="readOnly"

If you have a few fields on your form, you can just do this for each field. If you have a lot of fields, you’ll probably want to write this as a recursive function, and do all fields in a single function call. This can be quite fiddly, because you need to correctly handle all the different types of form objects. (Avoka can help with this – contact info-at-avoka.com for assistance.)

Pros
  • Inexpensive

Cons

  • Can be fiddly to program
  • While this makes the form appear to be read only, a clever end-user could still modify it. To modify it, open the form in Acrobat, use Forms/Manage Form Data…/Export Data… to export the data as XML, modify the XML, and then re-import the XML data using Forms/Manage Form Data…/Import Data… The form data will have changed, and nobody is any the wiser.

“Flattening” the form

Adobe have a server product called LiveCycle Output. One of the things that LC Output will do is “flatten” a form – that means that it will be converted from an editable type of PDF document to a more traditional “read-only” document. The fields are no longer editable fields, they are really now just boxes and text drawn onto the page.

Pros

  • This is much more secure than setting fields to read only. The XML data no longer exists, and cannot be modified.
  • No JavaScript programming required to achieve this – simply route your form to LiveCycle Output, and generate the flattened PDF.

Cons

  • It’s still possible to modify the PDF file to change what appears on the form. This is much harder, because the PDF is now in a binary format, but it’s possible.
  • Requires server-side integration
  • Requires purchasing LiveCycle Output (but LC Output does other useful things, so this may really be an overall benefit to your organization).

Digitally Signing the Document

Digitally signing the document doesn’t actually prevent the document from being modified, so needs to be used in conjunction with one of the above techniques. However, it does take a “snapshot” of the document, and if any changes are made, the signature will be invalidated. This enables you to guarantee that the version of the file you saved has not been modified since it was produced.

Pros

  • Guarantees that the PDF has not been modified since it was saved.

Cons

  • If signing is performed directly by the client, it requires Adobe Acrobat (or Reader Extensions)
  • If signing is performed on the server, then you must purchase a copy of LiveCycle Digital Signatures, and integrate this into your process.

Summary

There are several different techniques for making a form read-only. The one to use depends primarily on how willing you are to accept the risk of the document being changed (accidentally or maliciously) after it’s been produced, and how much you are willing to spend to achieve the level of protection you want.

Blog at WordPress.com.