AX1280

Configuring an Axiom form for printing (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, 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.

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 the default page layout for PDF printing

The PDF Size and PDF Orientation settings for the form can be used to set the default page layout for the PDF to the most appropriate configuration for printing.

To configure PDF layout properties 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, edit the following properties as needed:

    • PDF Size: Select the desired paper size for the PDF, such as A4, Letter, or Legal. The default size is Letter.

    • PDF Orientation: Select the desired orientation for the PDF: Auto, Portrait, or Landscape. The default orientation is Auto, which means that the orientation will be determined based on the width to height ratio of the form (for example, forms that are more wide than tall will be set to landscape).

      NOTE: The width and height of the canvas must be explicitly defined in order to calculate the ratio used for Auto—the assumed canvas size used in the browser is not applied to the PDF. You can use formulas in the Width and Height settings that reference the Is PDF property, so that the width and height can be blank when viewing the form, and then defined when generating a PDF. See Changing the form contents during PDF printing for more information on dynamically changing form settings during PDF generation.

    The PDF layout settings are used to determine the "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.

TIP: You can also modify these settings using the PDF Size and PDF Orientation fields at the top of the Form Control Sheet. However, in this case, you must know the valid text to enter for each option, because these fields do not have drop-down lists in the control sheet.

Changing the form contents during PDF printing

You can dynamically show or hide components or layers in the form for the PDF copy, or 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 the print Hyperlink component. 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.

If the form contains a Formatted Grid component, this may require special configuration for printing. For example:

  • The grid should be configured so that all columns fit the width of the component, otherwise the PDF will not display all columns. This can mean enabling Fit Columns for spreadsheet-formatted grids, or configuring sizes in the [ColumnWidth] row as appropriate to not exceed the component width (for example, all column widths add up to 100%). If necessary, you can dynamically enable Fit Columns or change the defined column widths based on the Is PDF setting.

  • If the number of rows may exceed the height of the component, then Extended Height should be enabled for the component, otherwise the PDF will not display all rows. Use of Extended Height will dynamically extend the bottom of the grid to fit all rows, so that they will all display in the PDF. If the extended height behavior should only be applied to the PDF and not when viewing the form online, then you can dynamically enable it based on the Is PDF setting. For more information on using Extended Height, see Setting row sizes for Formatted Grids.

  • If the grid uses [Fixed] rows, these rows do not have any special treatment in the PDF. They will not repeat at the top of the grid if the grid spans multiple pages.

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 size and orientation properties are taken from the target (parent) form.