Home >

On this page

AX1280

Configuring an Axiom form for printing

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.

There are two ways that users can generate a PDF of an Axiom form for printing:

  • In the Web Client toolbar, from the Tools menu , click Generate PDF.
  • Within the form, use a button that has been specially configured to generate a PDF of the target form.

The button option is recommended because it is more flexible and will work in all environments where forms can be viewed, including in the Desktop ClientGeneral term for using either the Excel Client or the Windows Client, both of which are installed to the user's desktop.. Additionally, when using a button you can clearly label the text something like "Print this report" (or similar), which is easier for end users to find and use.

NOTE: If users only need the contents of a Formatted Grid component, not the entire form, then the ability to export grid contents to a spreadsheet may be used as an alternative to printing. For more information, see Exporting Formatted Grid contents to a spreadsheet.

How the PDF is generated

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

When the user initiates PDF creation (using either the Web Client menu or a PDF button within the form), 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 (with all of the normal refresh behavior that applies when a form is initially rendered). A PDF is generated from the Axiom form, and then the PDF is opened in the browser.

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

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.

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.

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 modify these settings, click Edit Form Properties at the top of the Form Assistant task pane or the Form Designer dialog. The settings can also be edited manually at the top of the Form Control Sheet.

  • 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 this ratio; 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.

These 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.

Generating a PDF using a button in the form

You can place a button on the form itself to allow users to generate a PDF of the current form. The button can be a Button component or a Button tag for a Formatted Grid component.

To do this, use the Command button behavior and then select Download Form as PDF as the command. The command does not use any shortcut parameters.

When a user clicks the button, the PDF is generated in the same way as when using Tools > Generate 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.

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!D22="On","Off","On")

This formula hides the Hyperlink component when Is PDF is On.

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.