To change the margins, you must modify the ImageableArea section in the PPD file. ImageableArea provides the bounding box of the area in which the printer may print for the page size named mediaOption. There will be one statement for each named page size supported by the device. *DefaultImageableArea provides the mediaOption name of the default imageable area. Since there can be only one default page size, this value should be the same as the value of *DefaultPageSize, *DefaultPageRegion, and *DefaultPaperDimension.
The syntax for defining imageable area is as follows:
*ImageableArea mediaOption: "llx lly urx ury " *DefaultImageableArea: mediaOption | Unknown
ll
stands for lower left corner and ur
for upper right corner. The bounding box value of *ImageableArea is given as four real numbers, representing the x and y coordinates of the lower left and upper right corners of the region, respectively, in the PostScript language default user space coordinate system. The x and y axes of a given page size correspond to the x and y axes of that page size in the *PaperDimension entry.
The imageable area is defined as the part of the page where the printer may actually make marks. On some printers, the imageable area of a given page size varies as a result of the current resolution, amount of memory, the direction of paper feed, and other factors. In PPD files where the imageable area of a given page size can vary, the imageable area recorded for that page size will be the intersection of all possible imageable areas for that page size. This formula ensures that the available imageable area is never smaller than that shown in the PPD file and all marks made within the imageable area will be visible. It does, however, also mean that the imageable area in the current configuration might actually be larger than the imageable area shown in the PPD file.
The following table contains the option keywords currently registered for mediaOption
, which designates a given page size on a device:
Table 10-4 mediaOption
Keywords
mediaOption (Paper Size) | Size (pts) | Size (mm) | Size (inches) |
---|---|---|---|
Letter | 612 * 792 | 215.9 * 279.4 | 8.5 * 11 |
Legal | 612 * 1008 | 215.9 * 355.6 | 8.5 * 14 |
Ledger | 1224 * 792 | 431.8 * 279.4 | 17 * 11 |
Tabloid | 792 * 1224 | 279.4 * 431.8 | 11 * 17 |
A3 | 842 * 1191 | 297 * 420 | 11.69 * 16.54 |
A4 | 595 * 842 | 210 * 297 | 8.27 * 11.69 |
A5 | 420 * 595 | 148 * 210 | 5.83 * 8.27 |
B4 | 729 * 1032 | 257 * 364 | 10.12 * 14.33 |
B5 | 516 * 729 | 182 * 257 | 7.17 * 10.12 |
Example
To change the margins of an A4 page in the default.ppd
, you would perform the following steps:
- Modify the default page from
Letter
toA4
in the following sections:*% Page definitions *DefaultPageSize: A4 *PageSize A4: ” ” *% These entries set up the frame buffer. Usually used with manual feed. *DefaultPageRegion: A4 *PageRegion A4: “A4” *% These provide the physical dimensions of the paper (by keyword) *DefaultPaperDimension: A4 *PaperDimension A4: “595 842” - Add the margin definition in the following sections:*% Imageable (writable) areas for each page size, in pixels *DefaultImageableArea: A4 *ImageableArea A4: “2 2 593 840 ” Note:All PPD entries are case sensitive.