Use a connector as the PDF interface
Instead of defining a PDF interface by hand, you can set a connector as the data source for the template. The connector’s field catalog then defines the interface, so the template can receive the same data as an adaptive application that uses the same connector. This is what links a PDF template to an adaptive application for printing.
When a connector is set as the interface, the interface is read-only. You cannot add, remove, or edit interface rows, because the field catalog is the single source of truth. The interface tree still displays the field catalog, so you can bind components to it.
Prerequisites
-
You have a connector set up for the data source you want to use.
-
Your PDF template is open in the PDF Designer.
Procedure
-
In the side navigation, select Interface to open Interface and Test Data.
-
On the General tab, in the Connector section, turn on Use Connector as interface.
-
In Connector, select the connector to use as the data source.
Result: The interface fills with the connector’s field catalog and becomes read-only. Changing the connector later replaces the interface with the selected connector’s field catalog.
-
In Interface Shape, select how the template receives the connector data:
-
List: Choose List when the PDF repeats the same fields several times, for example, a table of orders. The
connectorfield is an array. Use this shape for a PDF that maps to an adaptive list application. -
Details: Choose Details when the PDF shows the fields of a single record, for example, one invoice. The
connectorfield is an object. Use this shape for a PDF that maps to an adaptive edit application.
Result: The
connectorrow in the interface changes between an array and an object to match the shape. This determines how you bind to it. -
-
Select the Interface tab to review the interface.
Result: The field catalog is listed with its types. The
connectorrow has the type Array for the List shape or Object for the Details shape, and each field, for exampleorder_number,customer, orregion, has the type from the table definition. -
In the Designer, bind your components to the interface:
-
Bind a repeating component, such as a Table, to the
connectormodel path, for example{/connector}. -
Bind an individual element, such as a Text element in a table row, to a field under
connector, for example{/connector/order_number},{/connector/customer}, or{/connector/region}.
In addition to
connector, the interface exposes:-
chart: The raw SVG of a chart, for chart reports. Bind an SVG component’s source to this field to print a chart from an adaptive business intelligence application.
-
-
In the Shell bar, select Save.
Keep the interface in sync with the field catalog
If the connector’s field catalog changes after you configure the template, the interface does not update on its own. The next time you open the template and toggle to edit mode, an Updated Field Catalog message asks whether to update the interface:
-
Select Yes to apply the new field catalog to the interface.
-
Select No to keep the interface as it is.
Result
-
The connector’s field catalog defines the PDF interface, and the interface is read-only.
-
The PDF template appears in the connector’s Where-Used list.
-
When you create a deployment that includes the PDF template, the deployment also captures its relation to the connector.
-
The template can receive data from an adaptive application that uses the same connector.