User Guide and Reference

Layout Issues

Hide Navigation Pane

Layout Issues

Previous topic Next topic No directory for this topic  

Layout Issues

Previous topic Next topic Topic directory requires JavaScript JavaScript is required for the print function  

Measurements

There are several different ways to specify measurements in Composer. There is also some "tension" between the different ways to specify measurements:

 

PDF is primarily a physical page-oriented technology, and the most natural way to specify measurements is in physical units, such as inches or mm.

HTML is primarily a screen-oriented technology, and the most natural way to specify measurements is in screen units, such as pixels for desktop devices.

Mobile devices (particularly iOS) prefer to measure in points (pt).

In responsive layout, the unit of measurement is the px, but this no longer means "pixels" as it did on the desktop.

Composer's Desktop style HTML rendering does attempt to mimic the page-oriented layout of PDF, whereas tablet and mobile rendering largely dispense with the page-orientation.

 

Composer allows you to enter measurements in any one of these units, and will convert these units on your behalf. Conversion from screen units to page units assumes a particular DPI, and mixing these units may result in slight discrepancies.

 

Measurements can be changed within a form for field widths and for margins. Most other measurements should be left alone, as they are balanced for use within the stylesheet.

 

Composer also allows you to specify measurements in percentages or weights if a layout manager is being used — in this case, the actual measurement will be calculated by Composer based on the relative sizes of several different components.

 

Images height and width are usually specified in pixels, based on the actual pixel size of the image. If you resize an image, best results are often obtained by using integral fractions of the original image size.

 

Recommendations

In general, you should avoid using explicit widths as far as possible. The main reasons for this are:

 

Often you don't know what size screen your users are going to be viewing your form on, and you should let Composer take care of sizing your fields to fit the screen. Use a layout manager rather than explicit widths.

Widths should be specified in the stylesheet, not in the form. This way, if you need to change anything, you can do it in a single place (the stylesheet) rather than having to do it in every single field.

 

If you do use explicit widths, we recommend:

 

Most of Composer's in-built stylesheets use page units in mm. Unless you have a specific reason to do otherwise, it's generally recommended to use mm.

If you are building forms primarily for HTML, and require very explicit control over sizes, specify pixels (px).

Note that the meaning of "px" has changed with the advent of high resolution mobile devices. See the relevant passage in Responsive Layout.

If you do need to apply particular sizes (e.g. widths) to your fields, consider using a named style-sheet entry, or a layout manager — this is more maintainable and flexible.