FME Transformers: 2024.2
FME Transformers: 2024.2
PDFPageFormatter
Prepares features for output to PDF by providing a convenient interface to set the scale and location of features on a page.
A single PDFPageFormatter transformer is intended to format one page of a PDF document. Using multiple PDFPageFormatter transformers will allow writing to the same PDF document.
Each input port is represented by one or more boxes on the page labelled with the port name. Features are scaled and centered preserving aspect ratio when they are placed in the appropriate box on the PDF page.
If more than one feature enters the same input port, the scaling and centering will be calculated based on the aggregate bounds of the input features. The features will be written to the PDF in the order they entered the input port.
The PDFPageFormatter affects the drawing order of features. Each box on the page will be completely drawn before drawing the next box. This overrides the Layer Order parameter of the PDF Writer. However, within each box, layer order will be preserved. Thus, if any features are routed through a PDFPageFormatter, then it is recommended to route all features through a PDFPageFormatter.
To remove an unused input port, delete its associated location box in the Edit Page Object dialog (right-click and select Delete). Alternatively, in the Workspace Navigator, double-click the Page Objects property of the transformer. In the Parameters dialog, select the input port and click the delete icon (—).
Configuration
Parameters
General
Preferred Unit |
Specifies the standard unit of measurement that displays in this dialog: Inches, Centimeters, or Points. Note: A point measures 1/72 of an inch. For example, a Letter-sized page measures 612 x 792 points. |
Page Number |
Specifies which page will contain the desired Page Objects. |
Page Layout
Page Size |
Selecting one of the commonly used page sizes will populate the Page Width and Page Height parameters with the corresponding dimensions of the selected page in the currently selected unit. |
Page Orientation |
Specifies the orientation of the page. Switching between Portrait and Landscape will swap the values of Page Width and Page Height. |
Page Width |
The width of the PDF page to be produced. The unit of this value is specified in the Preferred Unit parameter. |
Page Height |
The height of the PDF page to be produced. The unit of this value is specified in the Preferred Unit parameter. |
Page Object Locations
A visual rendering of the boxes on the page where content will be placed by the writer. Each box is labeled with the corresponding input port.
Boxes can be dragged to new locations and can be resized by dragging an edge or corner of the box.
To set the input port and location explicitly, double-click the box or select the ‘Properties…’ option on the context menu for a box. An Edit Page Object dialog opens, where you can specify the Input Port that is supplying the data for the box, as well as the position (Upper Left X coordinate and Upper Left Y coordinate) and size (Width and Height) of the box.
Page Object Properties
When editing the properties of any page object, the properties dialog offers the following options that apply specifically to this object and the subsequent frame to be created on the page in the resultant PDF.
Page Object
Input Port |
Which input port the page object corresponds to on the transformer. It is possible to map multiple input ports to the same page object if wanting to route the data in the workflow differently due to styling or order but have them drawn in the same location on the page. |
Object Placement
Specifies the group of four parameters to define the extents of the page object in page units. These initially reflect the current values of the page object bounds and will resize the page object on the canvas if changed.
Upper Left X |
The X coordinate of the upper left corner of the page object in page units. Changing these values will change the location of the page object on the canvas. |
Upper Left Y |
The Y coordinate of the upper left corner of the page object in page units. Changing these values will change the location of the page object on the canvas. |
Width |
The horizontal breadth of the page object in page units. Changing these values will resize the page object on the canvas. |
Height |
The vertical breadth of the page object in page units. Changing these values will resize the page object on the canvas. |
Input Feature Processing
Maintain Aspect Ratio |
The normal behavior of the transformer is to capture both the world bounds of the input features, the page bounds and the page object bounds to define the locations and size of the feature on the page. The default behavior is to scale the features in a uniform way in both X and Y dimensions, also known as maintaining the same aspect ratio or relative scaling for the height and width of each input feature geometry. By default, the Maintain Aspect Ratio setting of Yes will use the minimum scale factor for x and y to fit the input feature geometry bounds into the page object bounds, maintaining the shape of the input feature geometries. Conversely, a value of No will scale x and y values independently to obtain a better fit of the input features into the page object bounds at the cost of potentially distorting their shape and location. |
Clip Input Features |
Features that extend beyond the bounds of the page object were previously clipped to the bounds of the object. This option allows input features to optionally be clipped or to extend beyond the page object boundary when rendered. The new default is No indicating that the input features will not be clipped to the page object boundary. Note that in the default case the world rectangle is calculated using the bounds of the input features for this page object and thus when the input features are scaled to match the page object they should all fit inside. Exceptions may occur if the world rectangle is modified manually or if the bounds for the input features are not representative of the rendered geometry. This may occur specifically with text and multitext inputs which use only rough approximate bounds. |
Editing Transformer Parameters
Transformer parameters can be set by directly entering values, using expressions, or referencing other elements in the workspace such as attribute values or user parameters. Various editors and context menus are available to assist. To see what is available, click beside the applicable parameter.
How to Set Parameter Values
Defining Values
There are several ways to define a value for use in a Transformer. The simplest is to simply type in a value or string, which can include functions of various types such as attribute references, math and string functions, and workspace parameters.
Using the Text Editor
The Text Editor provides a convenient way to construct text strings (including regular expressions) from various data sources, such as attributes, parameters, and constants, where the result is used directly inside a parameter.
Using the Arithmetic Editor
The Arithmetic Editor provides a convenient way to construct math expressions from various data sources, such as attributes, parameters, and feature functions, where the result is used directly inside a parameter.
Conditional Values
Set values depending on one or more test conditions that either pass or fail.
Parameter Condition Definition Dialog
Content
Expressions and strings can include a number of functions, characters, parameters, and more.
When setting values - whether entered directly in a parameter or constructed using one of the editors - strings and expressions containing String, Math, Date/Time or FME Feature Functions will have those functions evaluated. Therefore, the names of these functions (in the form @<function_name>) should not be used as literal string values.
Content Types
These functions manipulate and format strings. | |
Special Characters |
A set of control characters is available in the Text Editor. |
Math functions are available in both editors. | |
Date/Time Functions | Date and time functions are available in the Text Editor. |
These operators are available in the Arithmetic Editor. | |
These return primarily feature-specific values. | |
FME and workspace-specific parameters may be used. | |
Creating and Modifying User Parameters | Create your own editable parameters. |
Dialog Options - Tables
Table Tools
Transformers with table-style parameters have additional tools for populating and manipulating values.
Row Reordering
|
Enabled once you have clicked on a row item. Choices include:
|
Cut, Copy, and Paste
|
Enabled once you have clicked on a row item. Choices include:
Cut, copy, and paste may be used within a transformer, or between transformers. |
Filter
|
Start typing a string, and the matrix will only display rows matching those characters. Searches all columns. This only affects the display of attributes within the transformer - it does not alter which attributes are output. |
Import
|
Import populates the table with a set of new attributes read from a dataset. Specific application varies between transformers. |
Reset/Refresh
|
Generally resets the table to its initial state, and may provide additional options to remove invalid entries. Behavior varies between transformers. |
Note: Not all tools are available in all transformers.
For more information, see Transformer Parameter Menu Options.
FME Community
The FME Community has a wealth of FME knowledge with over 20,000 active members worldwide. Get help with FME, share knowledge, and connect with users globally.
Search for all results about the PDFPageFormatter on the FME Community.