home *** CD-ROM | disk | FTP | other *** search
- -----------------------------------------------------------------------------
- 4th March 1994
- -----------------------------------------------------------------------------
- Support Group Application Note
- Number: 248
- Issue: 1.00
- Author: SH/PD
- -----------------------------------------------------------------------------
-
- Custom Page Sizes for PostScript(TM) Printing
-
-
- -----------------------------------------------------------------------------
- This note decribes how to create custom paper sizes for use with RISC OS 3
- !Printers and PostScript-equipped typesetters To make use of the information
- in this note, you will need the following software:-
- RISC OS 3, version 3.10 or later
- !Printers 1.22
-
-
-
- -----------------------------------------------------------------------------
- Applicable Hardware:
-
- Related Application Notes:
-
-
- -----------------------------------------------------------------------------
- Copyright (C) 1994 Acorn Computers Limited
-
- Every effort has been made to ensure that the information in this leaflet is
- true and correct at the time of printing. However, the products described in
- this leaflet are subject to continuous development and improvements and
- Acorn Computers Limited reserves the right to change its specifications at
- any time. Acorn Computers Limited cannot accept liability for any loss or
- damage arising from the use of any information or particulars in this
- leaflet. ACORN, ECONET and ARCHIMEDES are trademarks of Acorn Computers
- Limited.
- -----------------------------------------------------------------------------
- Support Group
- Acorn Computers Limited
- Acorn House
- Vision Park
- Histon
- Cambridge
- CB4 4AE
- -----------------------------------------------------------------------------
-
- Background
-
- The PostScript printer driver sets the output device's page size in the
- following manner. At the start of the print job, it looks up the paper size
- name (as set in the Configuration window of !Printers). This name, up to the
- first space character, is converted to lowercase and sent to the printer.
- Thus the paper size called "A4 (Generic PS)" is converted to the command "a4".
- The printer understands this command to mean "arrange for the imageable area
- to be of A4 dimensions", and also understands a small number of other
- well-known paper size names like "legal" and "letter". On an A4 laser
- printer, the "a4" command has little effect since that is the default page
- size. An A3 typesetter, on the other hand, will set up an imageable area
- exactly the size of an A4 page, and arrange for it to be suitably positioned
- on the A3 media.
-
- The need for custom page sizes arises when there is a requirement to place
- the printed image on a typesetter's film in a non-standard location or at a
- non-standard size. For example, when printing an A4 document on an A3
- typesetter, it is useful to include crop marks for accurate cutting.
- Applications that provide this facility attempt to centre the expanded A4
- image on the paper. It is therefore necessary to arrange for the
- typesetter's imageable area to be slightly larger than A4 so that the crop
- marks are visible.
-
- There are two steps involved in producing a custom page size. First you
- must define a paper size in !Printers so that the printer driver and the
- application are aware of the imageable area. This is done using the Paper
- Size dialogue box The paper size should be set up with your desired
- dimensions and a suitable name. Then you must provide a small PostScript
- procedure to do the actual work of altering the size and position of the
- image on the media. This involves editing one of !Printer's internal
- files, which is explained below.
-
- Editing the paper size
-
- This process will be explained in terms of creating a paper size to print
- an A4 page with extra space for crop marks on an A3 typesetter. The
- procedure is similar for other custom page sizes. Having loaded !Printers,
- use the iconbar menu to bring up the "Edit paper sizes" dialogue. Use the
- pop-up menu to the right of the "Paper size name" field to select "A4
- (Generic PS)" as a suitable starting point. The dialogue box will be
- automatically filled in with the dimensions of an A4 page:-
-
- <Insert DrawFiles.PaperS>
-
- Erase the name "A4 (Generic PS)" and replace it with the name you would like
- for your new page size. When choosing this name, bear in mind that it will
- be used to generate the page setup command in the manner described previously.
- A good choice of name might be "A4Extra (Linotype)" - note that there is no
- space between "A4" and "Extra". This name would result in the command
- "a4extra" being sent to the typesetter at page setup time. Your choice of
- paper names is limited by the fact that the resulting page setup command
- must not be an existing PostScript command - to avoid clashes, names of the
- form "xxExtra" and "xxCustom" are recommended.
-
- <Insert DrawFiles.PaperN>
-
- Now alter the "Width" and "Height" fields of the dialogue box to give the
- required size of imageable area. To accomodate crop marks, it should be
- sufficient to add twenty millimetres to the width and height. If desired,
- the graphics margins may also be altered at this stage; setting them to zero
- is advisable if you are attempting to print crop marks.
-
- <Insert DrawFiles.PaperU>
-
- Click OK to register the new paper size with !Printers. The new paper size
- is saved to disk automatically . Open the printer's configuration window
- and use the "Paper" menu to select the new paper size. You should now be
- able to see the size you have set up in relation to your document by turning
- on the display of print margins (if your application supports it). If you
- want the printer to use this paper size in future, choose "Save choices"
- from the !Printers iconbar menu.
-
- Writing the page setup procedure
-
- The next step is to enter a PostScript procedure to actually execute the
- required page setup commands. The procedure must be added to a special file
- held within a subdirectory of !Printers. Locate the icon for !Printers on
- your disc. Holding the SHIFT key, double-click on the icon to open the
- !Printers directory. Open the "ps" directory within it, and the the
- "PSfiles" directory within that. The file to be edited is called
- "PSProlog2"; make a backup copy of it in case you make a mistake. Then open
- the file in !Edit and scroll to the bottom. The exact contents of this file
- depends on your version of !Printers, but the end of it should look similar
- to this:-
-
- copy OKA{[3 1 roll/MKACC cvx]cvx 2 I 3 1 roll
- put}{pop }ifelse}forall/CharStrings exch def dup type/arraytype
- eq{font Matrix 3 -1 roll 6 array CCM def}{pop }ifelse/Encoding
- exch def currentdict end definefont pop}BD end
-
- The commands to be added differ between the various makes and models of
- typesetters. We describe two common variants - one for typesetters that
- support the setpageparams command, and the other for Level 2 PostScript
- devices that support setpagedevice.
-
- Method 1: setpageparams
-
- The setpageparams method works with a large number of popular devices listed
- at the end of this section. It may also work with some other devices. If
- in doubt, consult the typesetter's documentation, your bureau or the
- typesetter manufacturer.
-
-
-
-
- Add the following lines to the end of PSProlog2, replacing "a4extra" with
- your chosen name:-
-
- % A4 with space for crop marks, for typesetters supporting setpageparams
- /a4extra {
- statusdict begin
- 652 899 0 1 setpageparams
- end
- } def
-
- The part of this procedure that actually does the work is 652 899 0 1
- setpageparams, and it is this that should be modified to suit your page size.
- The other lines should not normally be altered. The four numbers before the
- setpageparams command are its parameters; they specify the page size and will
- need to be adjusted to match those you entered into the Page Size dialogue
- box. The syntax of the setpageparams command is:-
-
- width height margin orientation setpageparams
-
- The first two parameters control the size of the imageable area. They are
- specified in points (72nds of an inch); to convert from millimetres to
- points, multiply by 2.835. The width parameter is measured along the fast
- scan direction of the typesetter (i.e at right angles to the direction of
- paper motion). The height parameter is measured along the slow scan
- direction (i.e in the direction of paper motion).
-
- The margin parameter specifies how far the imageable area should be
- displaced from the start position of the fast scan. This is measured in
- points. Margin should normally be zero, but can be adjusted to correct for
- paper that has been loaded at an offset from the beginning of the fast scan.
-
- The orientation parameter specifies how the image is positioned with respect
- to the paper. A value of 0 causes the image's axes to be oriented such that
- y increases along the fast scan direction and x increases along the slow
- scan direction. A value of 1 causes x to increase in the fast scan direction
- and y to decrease in the direction of slow scan.
-
- The orientation can impact efficiency in terms of the amount of paper used
- per page. If, for example, the paper is 30cm wide, it is possible to fit the
- long side of an A4 page along the fast scan direction using orientation 0,
- thus minimising the length of paper used. For an image appreciably taller
- than A4, such as our A4Extra, the paper is not wide enough to do this and
- orientation 1 must be used instead.
-
- Having modified and saved the file, test it by sending a one-page printout
- to the device. If all is well, you should observe that the position of the
- image on the paper is different than it was when printing with the
- typesetter's standard configuration. If there appears to be no difference,
- or if the typesetter issues an error message, or if there is simply no
- output, you should first check that you have set the paper size in the
- printer configuration window, and also double-check your changes to
- PSProlog2.
-
- If the problem persists, or the typesetter produces an error message when it
- encounters the setpageparams command, it is likely that the typesetter does
- not support this command. If this is the case, consult your bureau or
- typesetter documentation to determine what equivalent commands are available.
- Put the correct commands in place of the setpageparams command. Another
- possibility is that your page size exceeds the device's capability. Consult
- the typesetter's documentation for the range of valid parameters to
- setpageparams.
-
-
-
-
-
-
- There follows a non-exhaustive list of devices that support setpageparams.
-
- AGFA-AccuSet Linotronic 200 v49.3
- AGFA-AccuSetSF Linotronic 200_230
- AGFA-ProSet9400 Linotronic 260
- AGFA-ProSet9400SF Linotronic 300 v47.1
- AGFA-ProSet9550 Linotronic 300 v49.3
- AGFA-ProSet9550SF Linotronic 300 v52.3
- AGFA-ProSet9600 Linotronic 330
- AGFA-ProSet9600SF Linotronic 500 v49.3
- AGFA-ProSet9700 Linotronic 500 v52.3
- AGFA-ProSet9700SF Linotronic 530
- AGFA-ProSet9800 Linotronic 630_630P
- AGFA-ProSet9800SF Linotronic 830
- AGFA-SelectSet5000 Linotronic 930
- AGFA-SelectSet5000SF Linotronic Pr60
- AGFA-SelectSet7000 Scantext 2030-51
- AGFA-SelectSet7000SF Varityper 4000/5100A
- AGFA-StudioSet2000 Varityper 4000/5300A
- Agfa-Compugraphic 9400P Varityper 4000/5300B
- Autologic APS-1000 v52.3 Varityper 4000/5300C
- Autologic APS-1560 v52.3 Varityper 4000/5300EA
- Autologic APS-4000 v52.3 Varityper 4000/5300EB
- Autologic APS-5000 v52.3 Varityper 4000/5300EC
- Autologic APS-6/108c v52.3 Varityper 4000/5330A
- Autologic APS-6/108ch v52.3 Varityper 4000/5330B
- Autologic APS-6/108chs v52.3 Varityper 4000/5330C
- Autologic APS-6/108h Varityper 4000/5500A
- Autologic APS-6/108hs Varityper 4000/5500B
- Autologic APS-6/70 v52.3 Varityper 4000/5500C
- Autologic APS-6/70c v52.3 Varityper 4000/5510
- Autologic APS-6/70ch v52.3 Varityper 4000/5630A
- Autologic APS-6/70chs v52.3 Varityper 4000/5630B
- Autologic APS-6/70vr v52.3 Varityper 4000/5660
- Autologic APS-6/80 v52.3 Varityper 4000/5860
- Autologic APS-6/84c v52.3 Varityper 4000/L300
- Autologic APS-6000 v52.3 Varityper 4000/L330
- Autologic APS-6600 v52.3 Varityper 4000/L500
- Autologic APS-7000 v52.3 Varityper 4000/L530
- Autologic APS-9800 v52.3 Varityper 4990
- Autologic APS-AccuSet v52.3 Varityper 4990T
- Autologic APS-BroadSheet Imager v52.3 Varityper 5100E
- Autologic APS-ColorMaster v52.3 Varityper 5100E
- Autologic APS-PlateMaster v52.3 Varityper 5660E
- Autologic APS-ProSet v52.3 Varityper 5860E
- Autologic LZR-1200 v52.3 Varityper 5960E
- Autologic LZR-2600 v52.3 Varityper 6000
- Linotronic 100 Varityper 6990
- Linotronic 200
-
- Method 2: setpagedevice
-
- Level 2 PostScript supports the setpagedevice command which, among other
- things, can be used to specify a custom page size. If you are unsure
- whether your device supports Level 2 PostScript, consult the typesetter's
- documentation, your bureau or the typesetter manufacturer.
-
- Add the following lines to the end of PSProlog2, replacing "a4extra" with
- your chosen name:-
-
- % A4 with space for crop marks, for devices supporting setpagedevice
- /a4extra {
- 4 dict dup begin
- /PageSize [652 899] def
- /Orientation 0 def
- /ImagingBBox null def
- /Policies 1 dict dup begin /PageSize 4 def end def
- end setpagedevice
- } def
-
- /PageSize [652 899] determines the size of the page. Replace the numbers
- in the square brackets with the width and height of your custom page size
- measured in points; to convert from millimetres to points, multiply by 2.835.
-
- The setpagedevice command attempts to orient your custom page on the
- physical medium so that the shorter side of the custom page size lies along
- the shorter side of the medium. To select the other orientation change the
- /Orientation setting to 1, but do not alter the width and height settings.
- The relationship between the image and the page size remains the same, so
- this is not a way of achieving "landscape" printing. If the device is unable
- to honour your orientation setting it may ignore it.
-
- The /ImagingBBox and /Policies lines should be copied verbatim from the
- example and not altered except on the explicit advice of your bureau.
-
- Having modified and saved the file, test it by sending a one-page printout
- to the device. If all is well, you should observe that the position of the
- image on the paper is different than it was when printing with the
- typesetter's standard configuration. If there appears to be no difference,
- or if the typesetter issues an error message, or if there is simply no
- output, you should first check that you have set the paper size in the
- printer configuration window, and also double-check your changes to PSProlog2.
-
- If the problem persists, or the typesetter produces an error message when it
- encounters the setpagedevice command, it is likely that the requested page
- size is outside the legal range for the device. If so, consult your bureau
- or typesetter documentation to determine what the allowed sizes are.
-
- Note: the exact effect of the setpagedevice command cannot be guaranteed to
- be consistent across different devices. The range of legal PageSize values
- and the policy used when choosing how to fit the requested page size onto
- the available media are device dependent, and to some extent installation
- dependent. Consult your typesetter documentation, your bureau or the
- typesetter manufacturer if you encounter difficulties.
-
-