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.
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.
Specifies which page will contain the desired Page Objects.
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.
Specifies the orientation of the page. Switching between Portrait and Landscape will swap the values of Page Width and Page Height.
The width of the PDF page to be produced. The unit of this value is specified in the Preferred Unit parameter.
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.
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.
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.
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.
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.
The horizontal breadth of the page object in page units. Changing these values will resize the page object on the canvas.
The vertical breadth of the page object in page units. Changing these values will resize the page object on the canvas.
Input Feature Processing
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.
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.
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 (—).
Editing Transformer Parameters
Using a set of menu options, transformer parameters can be assigned by referencing other elements in the workspace. More advanced functions, such as an advanced editor and an arithmetic editor, are also available in some transformers. To access a menu of these options, click beside the applicable parameter. For more information, see Transformer Parameter Menu Options.
Search FME Knowledge Center
Search for samples and information about this transformer on the FME Knowledge Center.