AX1280

Configuring an Axiom form for printing to PDF

If a user needs to print an Axiom form, they can do this in one of two ways:

  • Print the form using the native print functionality of the browser.
  • Use Axiom functionality to generate a PDF of the form and then print the PDF.

If the form is very simple and easily fits within a single standard page, then printing from the browser may be sufficient. However, if the form contains scrolling grids or if you have very specific print requirements, then it is best to configure the form for printing as a PDF. When using this approach you can dynamically adjust the form for the PDF output, to optimize the contents for printing.

NOTE: If users only need the contents of a grid, not the entire form, then the ability to export grid contents to a spreadsheet may be used as an alternative to printing. The following components all support the ability to export their contents to a spreadsheet: Data Grid, Fixed Report, and Formatted Grid.

User options to generate a PDF

If you want users to be able to generate a PDF of the form, it is recommended to make this feature available in the Web Client Task BarThe gray bar that displays across the top of browser-based Axiom files, as well as various feature pages of the Web Client. The Task Bar provides access to various tasks that are specific to the current area, page, or document.. Users can click the PDF icon in the task bar to generate the PDF. This approach makes the feature easily available and obvious to users.

Example Axiom form with PDF icon in task bar

By default, the PDF icon is disabled in Axiom forms. You must enable it if you want the icon to display for a particular form. The idea is that the icon should only be made available for Axiom forms where the PDF output has been configured and tested to result in nicely formatted and usable output.

To enable the PDF icon for a form:

  1. From the top of the Form Assistant task pane or the Form Designer dialog, click Edit form properties.

  2. In the Form Properties dialog, on the PDF Settings tab, select Show Task Bar PDF Button.

TIP: You can also enable the PDF icon by editing the Show Task Bar PDF Button field at the top of the Form Control Sheet. However, if you are modifying an older Axiom form, the field may not be present on the control sheet. In this case, you must use the Form Properties dialog to enable the property, which will automatically add the corresponding field to the control sheet.

Users can also generate a PDF of a form using the following methods:

  • Using the Generate PDF option on the Tools menu. This option is always available, but it is less obvious to end users. However, it can be useful in cases where a user needs to generate a PDF, but the PDF icon hasn't been enabled for the form.

  • Using a button in the form. In order to use this option, you must place a Button component (or a Button tag) in the form and configure it to use the Download Form as PDF command. Users can then click the button to generate the PDF.

    NOTE: When using this command, the button does not update the current form. Only the PDF generation occurs. This command cannot be combined with other commands.

    This option is primarily for backward-compatibility, to support forms that were created before the introduction of the PDF icon on the task bar. Going forward, we recommend using the PDF icon for consistency, so that the ability to generate a PDF of an Axiom form is always located in the same place. If you have an existing form that uses a button to generate a PDF, you can edit the form to remove the button and instead enable the PDF icon as described previously in this section.

All of these methods generate the PDF in exactly the same way. There is no difference in behavior; the only difference is the location where the user accesses the feature.

How the PDF is generated

Axiom Software uses a system-controlled property named Is PDF to track whether the form is currently being used to generate a PDF copy. This property is located at the top of the Form Control Sheet.

When the user initiates PDF creation, the following occurs:

  • On the server, a temporary copy is made of the form source file as it currently exists (the "print copy"). If the form has any changes that have not yet been submitted to the source file, these changes will not be reflected in the print copy. In other words, the act of initiating PDF creation does not trigger an update of the current form before the temporary print copy is made.

  • On the Form Control Sheet of the print copy, the property Is PDF is automatically set to On, and then the Axiom form is created based on the print copy. A PDF is generated from the Axiom form, and then the PDF is opened in the browser.

    This approach allows the form designer to dynamically change the form to optimize it for printing. For example, you can show or hide certain components or layers when printing by using an IF formula that references the Is PDF property. For more information, see Dynamically changing the form contents for PDF printing.

Once the PDF is opened in the browser, the user can print and/or save the PDF copy. The specific behavior for printing and saving the PDF depends on the local environment—such as the browser in use and the installed version of Adobe Acrobat Reader.

NOTE: The PDF's own scaling algorithm will be used to fit the content based on the PDF layout settings (see the following section).

Defining PDF settings for a form

You can configure various PDF settings for an Axiom form, including the page size and orientation, page margins, and header / footer text.

The page size and orientation settings are used to determine the form's "canvas size" for printing. For example, if the size is set to Letter and the orientation is set to Portrait, then Axiom Software will apply a canvas size of 8.5 x 11 inches to the form. Components that use dynamic size and position settings are adjusted based on the PDF canvas size.

To configure PDF settings for the form:

  1. From the top of the Form Assistant task pane or the Form Designer dialog, click Edit form properties.

  2. In the Form Properties dialog, on the PDF Settings tab, complete the settings as needed.

    TIP: You can also modify these properties using the corresponding fields at the top of the Form Control Sheet. However, if you are modifying an older Axiom form, some of these properties may not be present on the control sheet. In this case, you must first use the Form Properties dialog to configure the property, which will automatically add the corresponding field to the control sheet.

The following PDF settings are available:

Item Description

Size

The default paper size for the PDF, such as A4, Letter, or Legal. The default size is Letter.

Orientation

The page orientation for the PDF: Portrait or Landscape. The default orientation is Landscape.

Margin

Specifies the PDF page margins. Select one of the following:

  • None: No margin
  • Narrow: 0.5 inch margins all around
  • Normal: 1 inch margins all around (default)

If the PDF has no margins, but has defined header or footer text, then the header or footer text may display over the form contents. The form must have margins in order to have space to display header or footer text.

Show Task Bar PDF Button

Specifies whether to show the PDF icon in the Task BarThe gray bar that displays across the top of browser-based Axiom files, as well as various feature pages of the Web Client. The Task Bar provides access to various tasks that are specific to the current area, page, or document.. By default, this option is not enabled.

Header

Defines header text for the PDF. The variables {page_number} and {total_pages} can be used in the header.

Header Alignment

Specifies the alignment of the header text: Left (default), Center, or Right.

Footer

Defines footer text for the PDF. The variables {page_number} and {total_pages} can be used in the footer.

Footer Alignment

Specifies the alignment of the footer text: Left (default), Center, or Right.

If you want any of these settings to change dynamically based on the form contents, you can use formulas. In order to do this, you must modify these settings directly on the Form Control Sheet, in the section at the top of the sheet. For example, if refresh variables are used to change the contents of the form, you may want to display the currently selected variable values in the PDF header or footer.

Dynamically changing the form contents for PDF printing

You can dynamically show or hide components or layers in the form for the PDF copy, or dynamically change the settings of form components. To do this, use a formula that references the Is PDF property on the Form Control Sheet.

For example, in the print copy you may want to hide a Hyperlink component, because the hyperlink will not be live in the PDF. You can use a formula in the Visible property for that component, such as:

=IF(Control_Form!D29="On","Off","On")

This formula hides the Hyperlink component when Is PDF is On. Note that the Is PDF setting may be present at a different cell location in your Form Control Sheet; this formula is just an example.

NOTE: If the target form contains an Embedded Form component to display a child form, Is PDF is also set to On in the child form and can be used to impact the display of the child form. However, the PDF settings are taken from the target (parent) form.

Component-specific design considerations

Some components have unique design considerations to keep in mind when generating a PDF of the form. This list is not intended to be exhaustive of all potential considerations, but is meant to highlight certain known considerations:

  • Formatted Grid: You can configure certain component-level settings such as repeating headers and the number of rows to show per page. For more information, see Configuring a Formatted Grid component for printing to PDF.

  • Data Grid: For information on how Data Grid components are rendered in a PDF, see PDF design considerations.

  • Panels: Panel components support a style named pdf-page-break. If a panel uses this style, then when a PDF is generated a page break is automatically inserted after the panel. You can use this style to create a form with multiple panels, where each panel defines a page of the PDF. This style is only intended for use with simple configurations, and likely will not work as expected with complex form configurations or when attempting to combine it with other PDF settings (such as settings for Formatted Grids).