Expanding FDFs

An expanding FDF changes its width to the width of the containing cell. For barcodes, images, and videos, the original width to height ratio is maintained so they are not distorted. An FDF is set to Expanding in the FDF Editor.

Note: The expanding IPFGrid FDF, called the variable column IPFGrid, behaves slightly differently than the expanding FDFs described in this section. See Variable column grid.

This table describes the expanding FDFs and their behavior:

FDF Behavior
IPFAudio Expands to the width of the containing cell.
IPFBarcode Expands to the width of the containing cell, but the original width/height ratio of the barcode is preserved.
IPFChart Expands to the width of the containing cell.
IPFEmbeddedDocument Expands to the width of the containing cell.
IPFGauge Expands to the width of the containing cell.
IPFGoogleMap Expands to the width of the containing cell.
IPFImage Expands to the width of the containing cell, but the original width/height ratio of the image is preserved.
IPFVideo Expands to the width of the containing cell, but the original width/height ratio of the video is preserved.
IPFWebPage Expands to the width of the containing cell.
SLImage Expands to the width of the containing cell, but the original width/height ratio of the image is preserved.

How it works

When Expanding is set to false, the FDF has a static width. When set to true, the FDF expands to fill the width of the containing cell.

Also when Expanding is set to true, the FDF gets a new Boolean property named Maintain Aspect Ratio. The default value for this setting is false; the FDF uses a specified height. When true, the FDF aspect ratio, which is defined through specified width and height dimensions, is maintained when the width of the FDF is changed.

For the IPFWebPage FDF, you cannot set dimensions on the FDF itself, so the dimensions of the cell that the FDF is applied to are used when calculating the aspect ratio. For expanding FDFs where the aspect ratio is automatically maintained, such as image and video FDFs, this setting is set to true and cannot be changed.

The IPFImage and SLImage FDFs have a Boolean property named Crop to Aspect Ratio, which allows cropping of the image when the FDF aspect ratio does not match the natural aspect ratio of the image. An equal amount is cropped from the top and bottom or left and right sides, depending upon where cropping is needed.

The Crop to Aspect Ratio setting is used only when the aspect ratio of the image as defined through the width or height dimensions is different from the natural aspect ratio. When the setting is false, the image is scaled down, while maintaining the image’s aspect ratio, to fit inside the specified dimensions. The scaled down image is centered in the resulting image. For example, if the specified dimensions are 100 pixels wide and 100 pixels tall, and the natural image size is 200 pixels wide and 100 pixels tall, the resulting image will be 100 pixels wide and 100 pixels tall. The original portion of the image will be 100 pixels wide and 50 pixels tall, as it must be scaled down to fit inside the requested image dimensions, as shown here:

Original 200px x 100 px Scaled 100px x 100px
Crop to Aspect Ratio Original Crop to Aspect Ratio Scaled

When the setting is true, the image is scaled down until it fits inside one of the specified dimensions, and then cropped to fit inside the other dimension. An equal amount is cropped from each side of the image. For example, if the specified dimensions are 100 pixels wide and 100 pixels tall, and the natural image size is 200 pixels wide and 100 pixels tall, the resulting image will be 100 pixels wide and 100 pixels tall. The original portion of this image will be 100 pixels wide and 100 pixels tall; however, the left and right 50 pixels of the image are removed by the crop, as shown here:

Original 200px x 100 px Cropped 100px x 100px
Crop to Aspect Ratio Original Crop to Aspect Ratio Cropped
Note: The Customer Portal Home page in the 320 layout provides an example of images getting cropped as the viewport size changes. To avoid cropping significant areas of an image, we make these recommendations:
  • If the image looks better by cropping parts on the X axis, we recommend using a wider image.
  • If the image looks better by cropping parts on the Y axis, we recommend using a taller image.

Restrictions

When rendering for email, the Expanding setting is ignored.