SmartDoc Technologies Logo

AEM Forms Training

The world's leading AEM Forms training source

PDF Forms and Documents

Introduction

Portable Document Format (PDF) is actually a family of file formats, and this article details the ones that are most relevant for form developers. Many of the technical details and standards of different PDF types are evolving and changing. Some of these formats and specifications are International Organization for Standardization (ISO) standards, and some are specific intellectual property owned by Adobe.

This article shows you how to create various types of PDFs. It will help you understand how and why to use each one. All these types work best in the premier client tool for viewing and working with PDFs—Adobe Acrobat DC.

This is an example of a PDF/A file in Acrobat DC.

PDF/A File in Acrobat.
Note: The step-by-step instructions in this article were created with Adobe Acrobat DC. If you have a different version, the exact steps and screenshots may differ.

XFA PDF (PDF Form)

Adobe uses the term PDF form to refer to the interactive and dynamic forms you create with AEM Forms Designer. It’s important to note that there’s another type of PDF form, called an Acroform, that's different from the PDF forms you create in AEM Forms Designer. The forms and files you create with Designer are based on Adobe’s XML Forms Architecture (XFA). In many ways, the XFA PDF file format is closer to an HTML file than it is to a traditional PDF file. For instance, the following code shows you what a simple text object looks like in an XFA PDF file.

<draw name="StaticText1" y="15.875mm" x="28.575mm" w="29.2864mm" h="5.2331mm">
	<ui>
		<textEdit/>
	</ui>
	<value>
		<text>Text</text>
	</value>
	<font typeface="Myriad Pro"/>
	<margin topInset="0.5mm" bottomInset="0.5mm" leftInset="0.5mm" rightInset="0.5mm"/>
</draw>						

As you can see, XFA forms are XML based. This well-structured and flexible format enables an AEM Forms Server to transform your Designer files into many different formats, including traditional PDF, PDF/A and HTML. You can see the complete XML structure of your forms in Designer by selecting the XML Source tab of the Layout Editor. You can create both static and dynamic XFA forms in AEM Forms Designer.

Static forms

Static XFA PDF forms won’t change their layout at runtime, but they can be interactive for the user. The following are a few advantages of static XFA PDF forms:

You can create a static XFA PDF in Designer with the SmartDoc Expense Report form from your sample files. Follow these steps to create and view a static PDF form.

  1. Launch AEM Forms Designer.
  2. Open the smartdocExpenseReport.xdp file from the sample files.
  3. Select File - Save As to open the Save As dialog box.
  4. Enter expenseReportStatic.pdf as your filename.
  5. Select Adobe Static PDF Form (*.pdf) as your file type.
  6. Click Save.
  7. Launch Adobe Acrobat DC from the Windows Start menu. Please note that if you’re using the free Adobe Reader program, you won’t yet be able to use the commenting tools because this file has not been Reader extended.
  8. Select File - Open and browse to the static PDF you just created.
  9. Click the Add Expense button on the form. Notice that a new row is not created because this isn’t a dynamic PDF.
  10. Select Tools and navigate down to the Review & Approve section.
  11. Click the Comment icon. You can add comments to this type of PDF because it’s a static form.

Dynamic forms

Dynamic XFA PDFs can change their layout at runtime, so the commenting and markup features aren’t supported. However, dynamic XFA PDFs do offer the following advantages:

Static and Dynamic PDF Forms.
In static forms (top), you can change only the background fill of your text field at runtime. Dynamic forms (bottom) enable you to change almost any property of your form at runtime.

Follow these steps to create and view a dynamic PDF form:

  1. Go back to your smartdocExpenseReport.xdp file in Designer.
  2. Select File - Save As to open the Save As dialog box.
  3. Enter expenseReportDynamic.pdf as your filename.
  4. Select Adobe Dynamic XML Form (*.pdf) as your file type.
  5. Click Save.
  6. Launch Adobe Acrobat DC if it is not already open.
  7. Select File - Open and browse to the dynamic PDF you just created.
  8. Click the Add Expense button on the form. Notice that a new row is added because this is a dynamic PDF.
  9. Select Tools and navigate down to the Review & Approve section.
  10. Click the Comment icon. Notice that you can’t add comments to this type of PDF form.
Dynamic PDF Form.

PDF File (Traditional PDF)

The most popular and pervasive PDF format is the traditional PDF file. There are many ways of creating a traditional PDF file, including using Acrobat and many third-party tools. Acrobat provides all the following ways to create traditional PDF files. If you don’t have Acrobat installed, you may not see these options on your computer.

Under the hood, a traditional PDF is very different than an XFA PDF. It doesn’t have the same XML structure, and since it’s created by capturing the print stream of a file, a traditional PDF is a static and read-only file. You can create a traditional PDF file in AEM Forms Designer by following these steps.

  1. Launch AEM Forms Designer if it is not already open.
  2. Open the smartdocExpenseReport.xdp file from the sample files.
  3. Select File - Form Properties.
  4. Select Preview.
  5. Select Print Form (One-sided) for the Preview Type property.
  6. Locate the data file by clicking the Browse button to the right of the Data Field entry field.
  7. Select the expenseDataShort.xml from the sample files.
  8. Click Open.
  9. Select Dynamic XML Form for the Preview Adobe XML Form As property.
  10. Click OK to save these preview settings.
  11. Select Preview PDF to see your dynamic form merged with your data file. At this stage, your PDF is still an XFA PDF.
  12. Press F8 on your keyboard to display the Acrobat toolbar.
Preview PDF Form.
The Acrobat toolbar in Designer’s Preview PDF tab. If you click Save A Copy, you’ll create an XFA PDF. If you click Print File, you’ll create a traditional PDF.
  1. Click the Print File button.
  2. Select Adobe PDF as your printer.
  3. Click the Print button on the bottom right.
  4. Enter expenseReportTraditional.pdf as your filename.
  5. Click Save.

You have now created a traditional PDF file by capturing the print stream of your XFA PDF file. This new PDF file is static and read-only.

PDF File (Traditional PDF)


Dynamic documents

Since the source file for the SmartDoc Expense Report is a dynamic Designer file, the rendered files will grow or shrink based on the length of your data. You can repeat the steps above with the expenseDataLong.xml to create a much longer PDF file. This is an example of dynamic document generation.

Note: PDF Is an ISO Standard In 2008, PDF became an official ISO standard document format. ISO is a worldwide federation of national standards organizations, and its goal is to work with member countries to develop and promote international standards. The American National Standards Institute (ANSI) represents the United States of America in ISO. There are approximately 100 other countries represented in ISO.

Acroforms

Acroforms are Adobe’s older interactive form technology; they date back to Acrobat version 3. Adobe provides the Acrobat Forms API Reference, dated May 2003, to provide the technical details for this technology. Acroforms are a combination of the following items:

Acroforms can be enhanced and expanded with AEM Forms Designer. However, even when you enhance an Acroform in Designer, it’s still a traditional PDF under the hood, and there are limits to how interactive and dynamic you can make these forms. For instance, only some of the form fields in Designer’s Object Library are supported in Acroforms, and even the ones that work are only partially supported.

To move beyond the limits of Acroform technology, Adobe has invested in XFA to provide an XML form structure that’s both interactive and dynamic. If you’re moving from Acroforms to XFA PDFs, you need to know a couple of important facts about these two technologies:

PDF/A (PDFs for Archive)

PDF/A (PDF for Archives) builds on the document storage benefits of traditional PDFs with many specific details that enhance long-term archiving. The traditional PDF file format offers many benefits for long-term document storage. The compact nature of PDF facilitates easy transfer and conserves space, and its well-structured nature enables powerful indexing and search capabilities. Traditional PDF has extensive support for metadata, and PDF has a long history of supporting many different computer environments.

Like PDF, PDF/A is an ISO standard specification. It was developed by a task force that included AIIM (Association for Information and Image Management), NPES (National Printing Equipment Association), and the Administrative Office of the U.S. Courts. Since the goal of the PDF/A specification is to provide a long-term archive format, many PDF features are omitted so the files can be self-contained. The following are some key points about the specification that enhance the long-term reproducibility of the PDF/A file:

Viewing a PDF/A file

Two files in the sample files were created from the same Microsoft Word file. One was created as a traditional PDF and the other as a PDF/A file. Open these two files in Acrobat Professional:

Although the documents look the same, the PDF/A file opens with a blue bar across the top, indicating that you’re viewing this document in PDF/A mode. This blue bar is Acrobat’s document message bar, which you’ll see when you open certain types of PDF files.

Acrobat Document message bar.
The document message bar includes instructions, and possibly buttons, to help you complete a task. It’s color coded, and you’ll see the blue color when you open special types of PDFs (like this PDF/A file) as well as certified and digitally signed PDFs. The bar changes to purple for PDF forms and to yellow when you’re participating in a PDF review.

Note: If you click Enable Editing, you will take this document out of PDF/A compliance.

PDF/A compliance.
This message bar indicates that your file conforms to the PDF/A specification. You can find more compliance with Acrobat’s Preflight tool. Follow these steps to see how it works:
  1. Open the simpleWordFilePDFA.pdf file in Acrobat DC if it isn’t already open.
  2. Select Tools and navigate down to the Protect & Standardize section.
  3. Click the PDF Standards icon.
  4. Select Preflight on the right.

You will now see the Acrobat Preflight dialog box.

  1. Expand the PDF/A compliance panel.
Acrobat Preflight.
  1. Select the Convert to PDF/A-2b option.
  2. Click the Analyze button at the bottom of the dialog box.

Acrobat will compare your file to the PDF/A-2b profile and provide the results of the analysis.