Jump to main content

# How to Use the Anchoring Properties

Floating objects automatically adapt to whatever page margins you set for the page. When you add the overlay to a page, the object will keep the same position relative to the margins regardless of the margin values:

The way you set your anchors can affect both the size and positioning of the object:

- You can keep them in the same position relative to the specified margin(s) and maintain the original size.

- You can anchor an object’s center to the center of the useful page (the center point between the margins).

- You can stretch or shrink the object relative to the margins.

## Anchoring objects to the margins

Usually, you will want to keep a floating object the same size and position it relative to the margins. To “float” an object both horizontally and vertically without changing its size, you anchor the object to one horizontal and one vertical margin. All sides of the object move in relationship to those margins:

To… | Set…
--- | ---
Horizontal to … | Vertical to…
Position the object based on the position of the top and left margins | Left Margin | Top Margin
Position the object based on the position of the top and right margins | Right Margin | Top Margin
Position the object based on the position of the bottom and left margins | Left Margin | Bottom Margin
Position the object based on the position of the bottom and right margins | Right Margin | Bottom Margin

To illustrate how this works, we give you three examples below.

Positioning an object at the top left margin

In the illustration below, we show an overlay applied to two different pages. The overlay has a barcode field that has been placed at the top left margin:

To keep the barcode field in the same position relative to the top left corner of the page, we need to anchor it to the top and left margins. You would:

1. Place the field in the top left corner so the top and left sides are on the margins.

2. Set the anchoring properties as follows:

Anchor | Margin | Result
--- | --- | ---
Horizontal | Left Margin | The left side of the barcode field will always be positioned on the left margin.
Vertical | Top Margin | The top of the barcode field will always be positioned on the top margin.

Positioning an object in the top right corner

In this example, the same barcode field is positioned in the top right corner of the page 0.16" from the top margin and 0.4" from the right margin:

This time, we need to anchor the barcode field to the top and right margins to keep it in the same position relative to the top right corner of the page. You would:

1. Place the field in the top right corner below the top margin and to the right of the right margin.

2. Set the anchoring properties as follows:

Anchor | Margin | Result
Horizontal | Right Margin | The right side of the barcode field will always be the same distance from the right margin (0.4").
Vertical | Top Margin | The top of the barcode field will always be placed the same distance from top margin (0.16").

Positioning an object below the bottom margin

In this example, we position the same barcode field below the bottom margin and about 0.3" inches from the left margin. The top of the barcode field sits on the bottom margin:

Here we want the field to move with the left margin and bottom margin, so we position it relative to the bottom margin and the left margin. To keep the barcode field in the same position, you would:

1. Place the field in the bottom left corner of the page so the top sits on the bottom margin and the left side is 0.3" to the right of the left margin.

2. Set the anchoring properties as follows:

Anchor | Margin | Result
Horizontal | Left Margin | The left side of the barcode field will always be the same distance from the left margin (0.3").
Vertical | Bottom Margin | The top of the barcode field will always sit on the bottom margin.

Anchor | Margin | Result
Horizontal | Both Margins | The left and right sides of the rectangle will always be the same distance from the left and right margins.
Vertical | Both Margins | The top and bottom of the rectangle will always be the same distance from the top and bottom margins.

## Stretching objects

Sometimes it is actually desirable to allow a floating object to be stretched. For example, you may want to place a line to separate your footer information from the form or to place a border around the page at the margins. By allowing them to be stretched based on the form page margins, you can allow them to resize to fit the form.

Here is how it works:

To stretch an object… | Set…
Horizontal | Vertical
Horizontally across the page | Both Margins | Top Margin
OR
Bottom Margin
Vertically from the top to bottom of a form | Left Margin | Both Margins
OR
Right Margin
Both horizontally and vertically | Both Margins | Both Margins

To give you a better idea, we give you two examples below.

Creating a line that will always stretch from margin to margin

The overlay shown on the two pages below has a line that stretches between the margins near the bottom of the page:

The line is about 1 inch from the bottom margin. To create the above effect, you would do the following:

1. Draw a horizontal line that stretches from the left margin to the right margin and position it near the bottom margin.

2. Set the anchoring properties as follows:

Anchor | Margin | Result
--- | --- | ---
Horizontal | Both Margins | The ends of the line will always be attached to the left and right margins.
Vertical | Bottom Margin | The line will always be the same distance from the bottom margin.

Anchoring a page border

If you want to border your form pages, it is easier to place the rectangle border on an overlay so the rectangle doesn’t get in the way when you are selecting other objects on your page. You can easily create a border overlay that will anchor to the margins of any page:

For the above rectangle border to adjust to the margins, you need to anchor it to all four margins. To create the above border, you would:

1. Draw a rectangle that sits just outside the page margins. This will ensure that any objects on your pages that are aligned to the margins won’t run into the border.

2. Set the anchoring properties as follows:

## Anchoring objects to the center

The Center anchoring option anchors the center of the object to the center of the useful page area (the center point between the two margins). When the margins change, the center of the object will always be the same distance from the center of the page. The size of the object will not change:

To center an object… | Set…
Horizontal to… | Vertical to…
At the top margin | Center | Top Margin
At the bottom margin | Center | Bottom Margin
At the left margin | Left Margin | Center
At the right margin | Right Margin | Center
Between the top and bottom margins | Center, Left or Right | Center
Between the left and right margins | Center | Center, Top or Bottom
To the exact center of the page | Center | Center

Placing an object in the exact center of the page

By using both the horizontal and vertical centering options, you can place an object in the exact center of the page:

The object will always be centered to the center of the page, based on the position of the margins.

To center the object as we did above, you would do the following:

1. Set the page margins as follows:

- Make the Top and Bottom margins the same size.

- Make the Left and Right margins the same size.

This will allow you to use the Center and Middle positioning tools to center your object on the overlay.

2. Create the object on your overlay and center it to the page.

3. Set the following anchoring properties:

Anchor | Margin | Result
Horizontal | Center | The horizontal center of the object will always be centered between the left and right margins.
Vertical | Center | The vertical center of the object will always be centered between the top and bottom margins.

Important:

For layout purposes, it is important to have “equal” margins as we did above because the Center/Middle positioning tools center the object to the physical page. If your margins are offset, the object will not be centered between the margins when you create it.

Centering a system text box that contains a page number

In this example, we want to place the page number in the center of the page just below the bottom margin:

By using the Center option, we can place the text box in the center of any page:

To center the page number as we do above, you would do the following:

1. Make sure the left and right margins of your page are equal so you can use the Center positioning tool.

2. Create a system text box for the page numbers and position it below the bottom margin.

3. Center-align the text in the text box.

4. Center-align the text box to the page.

5. Set the following anchor properties:

Anchor | Margin | Result
--- | --- | ---
Horizontal | Center | The center of the text box will be centered between the left and right margins.
Vertical | Bottom Margin | The system text box will always be the same distance from the bottom margin.

Centering a logo

Logos can also be centered using the Center option. The center of the object will maintain its center position between the margins if the margins change:

To center a logo as shown in the example above, you would:

1. Make sure the left and right margins are equal.

2. Create your logo and center it to the page.

3. Set the following anchoring properties:

Anchor | Margin | Result
Horizontal | Center | The center of the logo will be centered between the left and right margins.
Vertical | Top Margin | The logo will always be the same distance from the top margin.

## Using only one anchor

Up to this point, our examples have used both horizontal and vertical anchors. However, it is possible to float an object horizontally only, leaving its vertical position absolute, or vertically only, leaving its horizontal position absolute:

Set… | To…
--- | ---
Horizontal to… | Vertical to…
Left Margin | None | Move the object only if the left margin changes. The vertical position will not change.
Right Margin | None | Move the object only if the right margin changes. The vertical position will not change.
Both Margins | None | Stretch or shrink the object relative to both the left and right margins. The vertical position will not change.
Center | None | Keep the object centered horizontally between the left and right margins. The vertical position will not change.
None | Top Margin | Move the object only if the top margin changes. The horizontal position will not change.
None | Bottom Margin | Move the object only if the bottom margin changes. The horizontal position will not change.
None | Both Margins | Stretch or shrink the object relative to the top and bottom margins. The horizontal position will not change.
None | Center | Keep the object centered vertically between the top and bottom margins. The horizontal position will not change.

Positioning a barcode field where the scanner can read it

Suppose that, in order to be read by an automatic scanning device, the bottom of a barcode field had to be ¼" from the bottom of the page. It can be anywhere horizontally, but you want it to be positioned at the right margin, so you can position form identifier information at the left margin, just under the bottom margin:

If the bottom margin position changes, the form information will shift with it, but the barcode field will not:

To create the above overlay, you would:

1. Create the system text box or text box containing the form information and place it at the left margin, just below the bottom margin.

2. Anchor it to the left margin horizontally and the bottom margin vertically.

3. Create a barcode field and position it so that the bottom is exactly ¼" from the bottom edge of the page. (To get the Y position of the object, add ¼" to the height of the barcode field and subtract the sum from the page height.)

4. Anchor it horizontally to the right margin and set the vertical margin to None.

## Special conditions and considerations

Once you understand the general principles for applying anchors, you can adapt them to handle just about any condition. Here are some situations when “special handling” is called for.

Anchoring lines

Anchoring lines to margins can be a little tricky. For instance, to stretch a line vertically, you would set the vertical anchor to Both Margins. The horizontal anchor would need to be set to Left Margin, Right Margin, Center, or None. If you set the horizontal anchor to Both Margins, the line will stretch diagonally instead of vertically:

The same concept applies to horizontal lines. To stretch a horizontal line, set the horizontal anchor to Both Margins. The vertical anchor of the horizontal line would need to be set to Top Margin, Bottom Margin, Center, or None. If you set the vertical anchor to Both Margins, the line will stretch diagonally:

Anchoring multiple objects

You may have a page footer that contains multiple objects, which you want to keep in the same relative position:

If this overlay is applied to a page with wider margins, the objects are distributed in the same relative position on the page:

To anchor multiple objects as shown above, you would:

1. Position your objects across the page.

2. Set the anchoring properties:

- Anchor objects that are at or near a margin to that margin.

- Anchor objects that are at or near the center of the page to the center.

For the above, you would set:

Text Box | Horizontal anchor | Vertical anchor
First | Left margin | Bottom Margin
Second | Center | Bottom Margin
Third | Right margin | Bottom Margin

When you anchor multiple objects across the page as we did in our example above, your objects can overlap if you apply your overlay to a page with margins that are too large:

To avoid this, we recommend that you design your overlays on a page with the largest possible margins you expect to use for a form. If you use the same overlay for both portrait and landscape pages, be sure to design it in portrait layout.