PDF2D Mapping File Directives

DATASET

Required/Optional: Required

The value for this directive is the path to the output file. If the output file does not exist, then the writer will create a new file. If the output file exists, then the writer will overwrite it. If other applications have the output file opened, then the writer will be unable to continue and the translation will fail.

Workbench Parameter: Destination PDF File

DEF

Required/Optional: Required

The PDF2D writer uses PDF2D_DEF lines to define feature types. A typical mapping file fragment specifying a feature type looks like:

PDF2D_DEF <featureName> \
	[pdf_layer_order <layerOrder>]? \
	[pdf_in_page_coordinates <pageCoordinates>]? \
	[pdf_default_opacity <opacity>]? \
	[pdf_layer_visibility <visibility>]? \
	[<attributeName> <attributeType>]*

The configuration parameters present on the definition line are described in the following table:

Parameter

Contents

featureName

The name of the feature type.

attributeName

The name of an attribute. The maximum length of attribute names is 200 characters.

attributeType

The type of the attribute. The only valid attribute type is string.

layerOrder

The layer order of the feature type. Valid values are all integers.

Feature types with lower layer orders will be drawn first. Therefore, features in feature types with higher layer orders will appear on top of features in feature types with lower layer orders. If a value is not specified, then the feature type will have an effective layer order value of ‘0’. If two features have identical layer order values, then the two will be ordered arbitrarily.

pageCoordinates

The value specifies to the writer whether the coordinates of geometries should be interpreted as being in page coordinates, for example inches such that they represent the location on the page. If this attribute is set to 'Yes', then the coordinates of the geometry are not altered and are treated as literal locations on the page.

If this attribute is set to 'No' then the accumulated bounds of the incoming geometries will be used to map the coordinates from the existing units onto the page.

The default value is NO.

opacity

This determines the opacity level of features of this feature type when their pdf_opacity feature attribute is unset.

If this parameter is set, the value overrides the writer parameter DEFAULT_OPACITY.

A value of 1.0 is fully opaque, and 0.0 is completely transparent.

visibility

If the value is VISIBLE, then the layer will be visible by default after opening the output file in Adobe Acrobat Reader. If set to HIDDEN, then the layer will not be initially visible. The visibility of layers can be toggled in Adobe Acrobat Reader after opening the file.

PAGE_SIZE

This directive specifies the size of the output page of the PDF document. The default page size is Letter.

Preset page sizes for common paper sizes can be selected, or the page size can be specified in typographical points in the format <width> <height>.

Required/Optional

Optional

Values

A3 | A4 | A5 | B5 | Ledger | Legal | Legal-half | Letter (Default) | Letter-half | <0 ...> <0 ...>

Workbench Parameter

Page size

PAGE_VIEWPORT (Location of Map on Page)

This directive determines where to place the map on the page, and how large the map should be on the page.

The format for this directive is four integers separated by spaces describing the lower left corner and the upper right corner of the viewport/rectangle, specified in typographical points. The lower left corner of the page contains coordinate (0,0) and the top right corner contains coordinate (<width>,<height>), where these two values are the page size specified by PAGE_SIZE.

If the aspect ratios of the page viewport and the world viewport (WORLD_VIEWPORT) differ, then the lesser scaling factor will be chosen: data inside the world viewport will not be clipped and data outside the world viewport might become visible.

If a value for the directive is not specified, then the page viewport rectangle will be a centered rectangle with a width and length that is 90% of the page width and length. The page viewport coordinates must be between (0,0) and (page width,page height).

Required/Optional

Optional

Values

<minimum x> <minimum y> <maximum x> <maximum y>

The values can also be specified as a percentage of the page width and page height. The values must be an integer ending with a percentage sign. The values can also be negative values, and they are interpreted as being relative to the top and right edges instead of the left and bottom edges. For example, for a page size of 1000 by 1000 points, the rectangle “50 50 –50 –50” is identical to the rectangle “50 50 950 950” for this page size.

Workbench Parameter

Page viewport dimensions

WORLD_VIEWPORT (Map Extents)

This directive specifies the extents of the map to write within the page viewport, by defining the lower left and upper right corners of the page viewport in map units.

Geometry outside these extents will be clipped when drawn on the page. The format for the directive is four floating point numbers separated by spaces describing the lower left corner and the upper right corner of the rectangle.

If a value for the directive is not specified, then the world viewport rectangle will be the bounding box of the entire dataset.

Required/Optional

Optional

Values

<minimum x> <minimum y> <maximum x> <maximum y>

Workbench Parameter

World viewport dimensions

DEFAULT_OPACITY

This directive specifies the opacity value of the fill color of area geometries. The boundaries of area geometries are not affected by this setting.

Required/Optional

Optional

Values

<0.0...1.0>

A value of 0 corresponds to complete transparency and a value of 1 is complete opaqueness.

Default Value: 0.4

Workbench Parameter

Default fill opacity value

DEFAULT_POINT_SIZE

This directive specifies the default radius in typographical points for point geometry.

Required/Optional

Optional

Values

<0.0...>

Default Value: 1.0

Workbench Parameter

Default point size value

DEFAULT_LINE_WIDTH

This directive specifies the default width in typographical points for line geometry and boundaries of area geometry.

Required/Optional

Optional

Values

<0.0...>

Default Value: 1.0

Workbench Parameter

Default line width value

PANEL_VISIBILITY

This directive determines the panel that is visible immediately after opening the output PDF file in Adobe Acrobat software.

Required/Optional

Optional

Values

None (default): No panel will be initially displayed

Layers: Layer panel will be visible after opening the file

Pages: Page Thumbnails panel will be visible

Workbench Parameter

Navigation Panel to Display

RANDOMIZE_FEATURE_TYPE_COLOR

This directive specifies whether features without the fme_color attribute set will be assigned a random color based on its feature type.

Required/Optional

Optional

Values

YES (default)

NO (features without the fme_color attribute set will be assigned the color black)

Workbench Parameter

Randomize Feature Type Color

RICH_TEXT

Required/Optional: Optional

This directive specifies whether the text string of text features is in the rich text format. If this directive is set to NO, then the text string is written as-is to the page. If this directive is set to YES, then the text string will be processed for style directives. For more details, see the “Text” section under Feature Representation.

Values: YES|NO

Default Value: NO

Workbench Parameter: Text in rich text format

FONT_DIRECTORIES

Required/Optional: Optional

This directive specifies the folders that the writer will search in to find the TrueType fonts used in the workspace. The workspace folder of the translation is always searched.

Values: <multiple folders>

Default Value:

Workbench Parameter: TrueType font folders

WRITE_ATTRIBUTES

Required/Optional: Optional

This directive specifies whether attribution data will be written. Not writing attribution data will decrease the file size of the output file and may improve viewing performance.

Values: YES|NO

Default Value: YES

Workbench Parameter: Write attributes

COMPRESS_STREAMS

Required/Optional: Optional

This directive specifies whether streams in PDF files will be compressed.

Values: YES|NO

Default Value: YES

Workbench Parameter: Compress streams

COMPRESS_OBJECT_STREAMS

This directive specifies the object stream compression, and the output format of the PDF cross-reference information and trailer.

If the directive is set to YES, the output file will contain compressed object streams, and cross-reference information will be stored in cross-reference streams.

If the directive is set to NO, the output file will not contain compressed object streams, and cross-reference information will be stored in a cross-reference table and trailer. Compressed object streams and cross-reference streams are supported in PDF1.5 and higher.

Required/Optional

Optional

Values

YES (default) | NO

Workbench Parameter

Compress Object Streams

PDF_14_COMPATIBILITY

Required/Optional: Optional

This directive specifies whether or not to write files compatible with PDF 1.4 viewers. The default value of NO means that features introduced in PDF 1.5 and later will be used, including object stream compression and the JPEG2000 raster image format. A value of YES means that the output file will not contain compressed object streams, cross-reference information is stored in a cross-reference table and xref trailer, and rasters are encoded in the JPEG format. Note that the COMPRESS_OBJECT_STREAMS directive is deprecated, and equivalent to the opposite of this directive.

Values: YES|NO

Default Value: NO

Workbench Parameter: PDF 1.4 Compatibility

FRAME_SPECS

Required/Optional: Optional

This directive can be used to specify frame and page properties (see the Multi-page Support section). If the output will have a static number of frames and pages (i.e., the number and properties of frames and pages is not dependent on the data) then this directive provides a convenient and simple method of specifying frame and page properties. The format for this directive is a whitespace-delimited sequence of keywords and values:

Specification: [PageSpec|FrameSpec]*
PageSpec: page <page number> PageSpecAttributes*
PageSpecAttributes:
page_size <page size>
FrameSpec: frame <frame name> FrameSpecAttributes*
FrameSpecAttributes:
   page_number <page number>
| frame_rectangle <frame rectangle>
| frame_order <frame order>
| world_rectangle <world rectangle>

The formats of the <page number>, <page size>, <frame rectangle>, <frame order>, and <world rectangle> values are identical to the formats for the pdf_page_number, pdf_page_size, pdf_frame_rectangle, and pdf_world_rectangle attributes respectively. The order that these attributes are specified is insignificant. Properties that are not specified will use their default values as described in the Multi-page Support section.

The following is an example value for this directive:

frame f1 frame_rectangle 10% 10% -10% -10% page_number 2
frame f2 frame_order 0
frame f3 frame_order 1
page 1 page_size 500 500

The result is as follows: The output document has two pages. Both pages have size 500x500 points (the unspecified second page inherits its page size from the first page). Frame “f1” will have a 10% margin on the second page. Frame “f3” will be drawn above frame “f2” on the first page, and the two frames will have the frame rectangle specified by the PAGE_VIEWPORT writer directive. All three frames use the world rectangle specified by the WORLD_VIEWPORT writer directive. Features can be written to one of these three frames by setting the pdf_frame_name attribute to “f1”, “f2”, or “f3”.

Workbench Parameter

Frame and Page Specification Lines