Feature Representation
In addition to the generic FME feature attributes that FME Workbench adds to all features (see About Feature Type Attributes), this format adds the format-specific attributes described in this topic.
FME raster features represent raster data and use several concepts that are unlike those used in the handling of vector data. See About FME Rasters.
PDF files can be written with non-square pixel dimensions.
PDF supports rasters with an arbitrary number of bands, provided all bands are the same data type and no band has a palette. PDF also supports rasters with a single band that has a palette.
pdf_type: any
Features with the pdf_url or the pdf_tooltip attribute set become annotation objects. There are several behavioral differences between annotation objects and non-annotation objects:
- Annotation objects will always appear above non-annotation objects, regardless of layer ordering.
- The interactive area of an annotation object is the rectangular bound of the feature instead of its precise outline.
- Annotation objects are no longer selectable through the Object Data tool or the Model Tree interface.
- Even when the annotation object’s layer is hidden, the annotation will still provide tooltips and be interactive. The annotation object’s parent layer does not affect the visibility of the annotation; only the object’s layer itself will affect its visibility.
pdf_type: pdf_point
A PDF point feature is drawn as a point with a radius of 1 typographical point.
The following attribute is applicable to point features:
pdf_point_width |
The value specifies the point width in typographical points of point geometries. Range: <float> Default: 1.0 |
pdf_type: pdf_line
A PDF line feature is drawn as a stroked line.
pdf_type: pdf_area
A PDF area feature is written as a filled area with a stroked boundary. The fill opacity is controlled by the Default Fill Opacity parameter.
pdf_type: pdf_collection
Each component of a PDF collection feature is drawn according to their geometry type.
pdf_type: pdf_text
A PDF text feature is drawn as a text annotation according to its fme_text_string, fme_text_size, and fme_rotation attributes.
The encoding of the text string is determined as follows:
- If the font is one of the PDF Core 14 fonts, then the string is decoded using Windows ANSI code page 1252.
- If the font is a TrueType font, then the string is decoded using the Macintosh Roman code page. If the TrueType font has a Microsoft Symbol character map table, then the font is treated as a symbolic font, and the text string can specify characters in the FF00-FFFF range of the character map by encoding only the low-byte of the code point.
Desired characters in symbolic fonts can either be specified using XML numeric character references (NCR) in rich text format (see below) or if the code point coincides with ASCII characters, the ASCII characters themselves.
Note that text and multitext geometries in FME currently do not support justification and have an insertion point of the text baseline and the left edge of the text bounding box. Due to the FME text geometry bounds being only an approximation, these are not attempted to be mapped to the PDF lower left corner bounds text justification model. Instead, the insertion points are mapped directly. The result is that, unlike non-text geometries, rendered text may appear below the expected insertion point, particularly for multitext geometries.
The following attributes are applicable to text features:
Attribute Name |
Contents |
---|---|
pdf_text_font |
The value specifies the default font family of the text representation. If left blank, Helvetica will be used.
Default: Helvetica |
pdf_text_underline |
If the value is Y, the text will be underlined. Default: N |
pdf_text_strikethrough |
If the value is Y, the text will have a strikethrough. Default: N |
pdf_text_bold |
If the value is Y, the text will have a bold style. Default: N |
pdf_text_italic |
If the value is Y, the text will have an italic or oblique style. Default: N |
The text string can be specified in a rich text format. The format is a subset of XHTML. For more information on XHTML, visit http://www.w3.org/TR/xhtml1/. The following are the supported XML elements:
<body>...</body>, <span>...</span>, <p>...</p> | Can be used to specify a style for its enclosed text through its “style” attribute. |
<b>...</b> | Bolds the enclosed text. |
<i>...</i> | Italicizes the enclosed text. |
<u>...</u> | Underlines the enclosed text. |
<del>...</del> | Adds a strikethrough to the enclosed text. |
<br/> | Adds a line break. |
The “style” XML attribute has the following format:
“property:value;...;property:value”
The following properties are supported:
font-family | Specifies the font family of the text. |
font-size | Specifies the point size of the font. |
color | Specifies the color of the text. The color can be specified through the format “#RRGGBB” where each color component is specified as a hexadecimal value, or through the 16 HTML color names (http://www.w3.org/TR/REC-html40/types.html#h-6.5). |
text-decoration | Valid values are “underline” and “line-through”. |
The following is an example rich text fme_text_string value:
<body>Hello<br/><span style=”font-size:30”>World!</span></body>
In the PDF document, the text “Hello” will use the styling specified through the format attributes. The text “World!” appears on the next line and will have a font size of 30 but will inherit all other style attributes.
pdf_type: pdf_raster
A PDF raster feature is drawn as a grid of pixels comprising an image. Rasters written to PDF are converted to a JPEG2000 byte string and stored as a blob. Therefore, the nature of raster support is defined by the JPEG2000 format.
The following attribute is applicable to raster features:
Attribute Name |
Contents |
---|---|
pdf_raster_compression_level |
It sets the quality of the compression. The range of the value is from 0 (best quality) to 100 (worst quality). The default value is 75. Setting the value to 0 enables lossless compression. This is a writer attribute. |