Requirements for Page Setup in Jdraw


When the user selects the `Page Setup ...' item in the `File' menu, the system displays the dialog shown in Figure 1.


Figure 1: Pages dialog.



The page setup dialog allows the user to set properties of how a drawing is laid out on printed pages. The `Orientation' setting defines the width-by-height orientation of pages. When the `portrait' selection is on, pages are laid out with the width dimension running horizontally and the height dimension running vertically. When `landscape' is on, the width dimension runs vertically and the height dimension horizontally. `portrait' is the default setting.

The `Page Size' values define the size of a page in printer's points. Per normal typography standards, a point equals 1/72 inch. The `Margins' settings define the outer edges of the page on which printing does not occur. When a drawing is printed, the portions of the drawing within each page boundary are printed on a page of the specified size within the specified margins. When possible, Jdraw determines page size and margin settings from the currently selected printer and displays those as the default values in the page setup dialog. When Jdraw cannot determine page size and margins from the printer, it uses the defaults shown in Figure 1. The size of 612 by 792 points equals the standard page size of 8 1/2 by 11 inches. The 36 point default margins equal 1/2 inch each.

The user can adjust the page size and margin settings to accommodate the paper size and margin requirements of different printers. In so doing, the user must be careful not to enter page size or margin values that cannot be accommodated on a particular printer. For example, if the user enters values of 0 for all margins, and the printer cannot print on 100% of an 8 1/2 by 11 sheet of paper, then portions of the drawing that extend into the unprintable margins will be lost on the printed page.

The `Drawing Size' settings define the number of printable pages in a drawing. The default is 1 page. The user can draw on a canvas beyond the printed page boundaries, but none of the drawing outside of the page boundaries appears on a printed page.

The `Drawing Scale' value defines the scale of the drawing relative to the page. This value is independent of the drawing zoom level. The default scale is 100%.

The `Page Order' selection defines the linear order in which pages are sent to the printer. The default selection is by rows, meaning that pages are sent to the printer in row-by-row order. The other selection is column-by- column order.

The `Page Boundaries' selection defines whether boundaries are visible on the drawing canvas. When shown, the boundaries are drawn as light-grey dashed lines. The default is `show'. When `hide' is selected, the page boundaries are still present in the drawing, just not visible on the canvas.

After changing any page settings, the user can press the `Defaults' button to restore the system-defined default values.

Figure 2 shows the default page configuration for a simple drawing with three rectangles.


Figure 2: Default page layout for a simple drawing.



In this case, the size of the canvas window is larger than the page size, so the full page is visible in the window. The background of the page area is white and the background beyond the page boundary is light grey. The user can draw on the grey area, but none of that drawing is printable.

Figure 3 shows the user having changed the page settings for orientation, page size, margins, and drawing size.


Figure 3: Page dialog edited.



The slightly adjusted page size of of 595 by 842 points is for a printer loaded with A4 paper. The smaller margins of 27 points are for a printer with a margin requirement of only 3/8 inch on all sides. When the user confirms the new page settings by pressing `OK', the system redraws the canvas as shown in Figure 4.


Figure 4: A 2x3 page layout with scrollbars.



The change in page orientation affects only the page boundaries, not the objects drawn on the canvas. That is, changing the page orientation does not rotate the drawn objects. Both the orientation and size of the page boundaries has changed from Figure 2 to Figure 4, reflecting all of the changes made by the user. The page size change is not that easy to see in the figures, given that the magnitude of the change is relatively small (from 8 1/2 by 11 to A4, with a small margin change).

With the larger number of pages, the entire paged area is not visible in the drawing canvas. When this occurs, the system adds vertical and horizontal scroll bars to allow the user to scroll throughout the entire paged area of the drawing. Scroll bars are added in this way whenever the size of the canvas window is smaller than the size of the paged drawing area at the current zoom level. If one dimension is fully visible in the window, only a single scrollbar is added for the not-fully-visible dimension.

The unpaged grey area of a drawing is always drawn down and to the right of the paged area. In this way, the upper left corner of the drawing canvas always coincides with the upper left corner of the first page, whenever the paged area is fully visible in the canvas window. When the paged area is scrolled, the rightward and downward scrolling extends to the right and bottom edges of the paged area, and not beyond. For example, Figure 5 shows the result of the user having scrolled Figure 4 all the way down and to the right.


Figure 5: The 2x3 page layout scrolled all the way down and right.



Given the preceding scrolling rules, the only time the unpaged grey area is visible in a canvas window is when the window is larger than the paged area. This occurs when the default drawing size is smaller than the default window size, as in Figure 2. It can also occur when the user enlarges a window or zooms out in a window. For example, Figure 6 shows the result of the user zooming to 0.5 magnification from Figure 4.


Figure 6: The 2x3 page layout zoomed out.



Figure 7 illustrates the user having restored the drawing zoom to normal, and set the `Drawing Scale' value to 200%.


Figure 7: Page layout with normal zoom and drawing scale set to 200%.



The page sizes in Figure 7 are the same as in Figure 6, but the drawing size in Figure 7 is normal. This illustrates how the drawing scale setting defines the drawing size relative to pages, without scaling the drawing on the screen.

Figure 8 shows the result of changing the `Page Boundaries' selection to `hide'.


Figure 8: Drawing with page boundaries hidden.



With page boundaries hidden, the dashed page lines are completely removed, including around the outer boundaries of the paged area.

The page size and margin values define the absolute size of a drawing, independent of screen resolution, printer resolution, or paper size. At normal zoom and 100% page scaling, the actual size of drawn objects on both the screen and printed page is determined by the page size and margin values. In order for object sizes to be accurately rendered on the screen, the screen size of a page equals the full page size minus the margins. For example, with the default page size of 612 by 792 points, and default margins of 36 points, the size of a page on the screen is 540 by 720 points. In this way, objects drawn on the screen, and in particular objects drawn across page boundaries, are both displayed and printed properly to scale.