home *** CD-ROM | disk | FTP | other *** search
/ Acorn User 4 / AUCD4.iso / acorn / documents / appnotes / 246-260 / 248c.arc / Text
Encoding:
Text File  |  1994-03-23  |  15.9 KB  |  327 lines

  1. -----------------------------------------------------------------------------
  2. 4th March 1994
  3. -----------------------------------------------------------------------------
  4. Support Group Application Note
  5. Number: 248
  6. Issue: 1.00
  7. Author: SH/PD
  8. -----------------------------------------------------------------------------
  9.  
  10. Custom Page Sizes for PostScript(TM) Printing
  11.  
  12.  
  13. -----------------------------------------------------------------------------
  14. This note decribes how to create custom paper sizes for use with RISC OS 3 
  15. !Printers and PostScript-equipped typesetters To make use of the information 
  16. in this note, you will need the following software:-
  17. RISC OS 3, version 3.10 or later
  18. !Printers 1.22
  19.  
  20.  
  21.  
  22. -----------------------------------------------------------------------------
  23. Applicable Hardware: 
  24.  
  25. Related Application Notes: 
  26.  
  27.  
  28. -----------------------------------------------------------------------------
  29. Copyright (C) 1994 Acorn Computers Limited 
  30.  
  31. Every effort has been made to ensure that the information in this leaflet is 
  32. true and correct at the time of printing. However, the products described in
  33. this leaflet are subject to continuous development and improvements and
  34. Acorn Computers Limited reserves the right to change its specifications at
  35. any time. Acorn Computers Limited cannot accept liability for any loss or
  36. damage arising from the use of any information or particulars in this
  37. leaflet. ACORN, ECONET and ARCHIMEDES are trademarks of Acorn Computers
  38. Limited.
  39. -----------------------------------------------------------------------------
  40. Support Group
  41. Acorn Computers Limited
  42. Acorn House
  43. Vision Park
  44. Histon
  45. Cambridge
  46. CB4 4AE                                                  
  47. -----------------------------------------------------------------------------
  48.  
  49. Background
  50.  
  51. The PostScript printer driver sets the output device's page size in the 
  52. following manner.  At the start of the print job, it looks up the paper size 
  53. name (as set in the Configuration window of !Printers).  This name, up to the 
  54. first space character, is converted to lowercase and sent to the printer.  
  55. Thus the paper size called "A4 (Generic PS)" is converted to the command "a4".  
  56. The printer understands this command to mean "arrange for the imageable area 
  57. to be of A4 dimensions", and also understands a small number of other 
  58. well-known paper size names like "legal" and "letter".  On an A4 laser 
  59. printer, the "a4" command has little effect since that is the default page 
  60. size.  An A3 typesetter, on the other hand, will set up an imageable area 
  61. exactly the size of an A4 page, and arrange for it to be suitably positioned 
  62. on the A3 media.
  63.  
  64. The need for custom page sizes arises when there is a requirement to place 
  65. the printed image on a typesetter's film in a non-standard location or at a 
  66. non-standard size.  For example, when printing an A4 document on an A3 
  67. typesetter, it is useful to include crop marks for accurate cutting.  
  68. Applications that provide this facility attempt to centre the expanded A4 
  69. image on the paper.  It is therefore necessary to arrange for the 
  70. typesetter's imageable area to be slightly larger than A4 so that the crop 
  71. marks are visible. 
  72.  
  73. There are two steps involved in producing a custom page size.  First you 
  74. must define a paper size in !Printers so that the printer driver and the 
  75. application are aware of the imageable area.  This is done using the Paper 
  76. Size dialogue box   The paper size should be set up with your desired 
  77. dimensions and a suitable name.  Then you must provide a small PostScript 
  78. procedure to do the actual work of altering the size and position of the 
  79. image on the media.   This involves editing one of !Printer's internal 
  80. files, which is explained below. 
  81.  
  82. Editing the paper size
  83.  
  84. This process will be explained in terms of creating a paper size to print 
  85. an A4 page with extra space for crop marks on an A3 typesetter.  The 
  86. procedure is similar for other custom page sizes.  Having loaded !Printers, 
  87. use the iconbar menu to bring up the "Edit paper sizes" dialogue.  Use the 
  88. pop-up menu to the right of the "Paper size name" field to select "A4 
  89. (Generic PS)" as a suitable starting point.  The dialogue box will be 
  90. automatically filled in with the dimensions of an A4 page:-
  91.  
  92. <Insert DrawFiles.PaperS>
  93.  
  94. Erase the name "A4 (Generic PS)" and replace it with the name you would like 
  95. for your new page size.  When choosing this name, bear in mind that it will 
  96. be used to generate the page setup command in the manner described previously.  
  97. A good choice of name might be "A4Extra (Linotype)" - note that there is no 
  98. space between "A4" and "Extra".  This name would result in the command 
  99. "a4extra" being sent to the typesetter at page setup time.  Your choice of 
  100. paper names is limited by the fact that the resulting page setup command 
  101. must not be an existing PostScript command - to avoid clashes, names of the 
  102. form "xxExtra" and "xxCustom" are recommended.
  103.  
  104. <Insert DrawFiles.PaperN>
  105.  
  106. Now alter the "Width" and "Height" fields of the dialogue box to give the 
  107. required size of imageable area.  To accomodate crop marks, it should be 
  108. sufficient to add twenty millimetres to the width and height.  If desired, 
  109. the graphics margins may also be altered at this stage; setting them to zero 
  110. is advisable if you are attempting to print crop marks.
  111.  
  112. <Insert DrawFiles.PaperU>
  113.  
  114. Click OK to register the new paper size with !Printers.  The new paper size 
  115. is saved to disk automatically .  Open the printer's configuration window 
  116. and use the "Paper" menu to select the new paper size.  You should now be 
  117. able to see the size you have set up in relation to your document by turning 
  118. on the display of print margins (if your application supports it).  If you 
  119. want the printer to use this paper size in future, choose "Save choices" 
  120. from the !Printers iconbar menu.
  121.  
  122. Writing the page setup procedure
  123.  
  124. The next step is to enter a PostScript procedure to actually execute the 
  125. required page setup commands.  The procedure must be added to a special file 
  126. held within a subdirectory of !Printers.  Locate the icon for !Printers on 
  127. your disc.  Holding the SHIFT key, double-click on the icon to open the 
  128. !Printers directory.  Open the "ps" directory within it, and the the 
  129. "PSfiles" directory within that.  The file to be edited is called 
  130. "PSProlog2"; make a backup copy of it in case you make a mistake.  Then open 
  131. the file in !Edit and scroll to the bottom.  The exact contents of this file 
  132. depends on your version of !Printers, but the end of it should look similar 
  133. to this:-
  134.  
  135. copy OKA{[3 1 roll/MKACC cvx]cvx 2 I 3 1 roll
  136. put}{pop }ifelse}forall/CharStrings exch def dup type/arraytype
  137. eq{font Matrix 3 -1 roll 6 array CCM def}{pop }ifelse/Encoding
  138. exch def currentdict end definefont pop}BD end 
  139.  
  140. The commands to be added differ between the various makes and models of 
  141. typesetters.  We describe two common variants - one for typesetters that 
  142. support the setpageparams command, and the other for Level 2 PostScript 
  143. devices that support setpagedevice.
  144.  
  145. Method 1: setpageparams
  146.  
  147. The setpageparams method works with a large number of popular devices listed 
  148. at the end of this section.  It may also work with some other devices.  If 
  149. in doubt, consult the typesetter's documentation, your bureau or the 
  150. typesetter manufacturer.
  151.  
  152.  
  153.  
  154.  
  155. Add the following lines to the end of PSProlog2, replacing "a4extra" with 
  156. your chosen name:-
  157.  
  158. % A4 with space for crop marks, for typesetters supporting setpageparams
  159. /a4extra {
  160.   statusdict begin
  161.     652 899 0 1 setpageparams
  162.   end
  163. } def
  164.  
  165. The part of this procedure that actually does the work is 652 899 0 1 
  166. setpageparams, and it is this that should be modified to suit your page size. 
  167.  The other lines should not normally be altered.  The four numbers before the 
  168. setpageparams command are its parameters; they specify the page size and will 
  169. need to be adjusted to match those you entered into the Page Size dialogue 
  170. box.  The syntax of the setpageparams command is:-
  171.  
  172. width height margin orientation setpageparams
  173.  
  174. The first two parameters control the size of the imageable area.  They are 
  175. specified in points (72nds of an inch); to convert from millimetres to 
  176. points, multiply by 2.835.  The width parameter is measured along the fast 
  177. scan direction of the typesetter (i.e at right angles to the direction of 
  178. paper motion).  The height parameter is measured along the slow scan 
  179. direction (i.e in the direction of paper motion). 
  180.  
  181. The margin parameter specifies how far the imageable area should be 
  182. displaced from the start position of the fast scan.  This is measured in 
  183. points.  Margin should normally be zero, but can be adjusted to correct for 
  184. paper that has been loaded at an offset from the beginning of the fast scan.
  185.  
  186. The orientation parameter specifies how the image is positioned with respect 
  187. to the paper.  A value of 0 causes the image's axes to be oriented such that 
  188. y increases along the fast scan direction and x increases along the slow 
  189. scan direction.  A value of 1 causes x to increase in the fast scan direction 
  190. and y to decrease in the direction of slow scan.
  191.  
  192. The orientation can impact efficiency in terms of the amount of paper used 
  193. per page.  If, for example, the paper is 30cm wide, it is possible to fit the 
  194. long side of an A4 page along the fast scan direction using orientation 0, 
  195. thus minimising the length of paper used.  For an image appreciably taller 
  196. than A4, such as our A4Extra, the paper is not wide enough to do this and 
  197. orientation 1 must be used instead.
  198.  
  199. Having modified and saved the file, test it by sending a one-page printout 
  200. to the device.  If all is well, you should observe that the position of the 
  201. image on the paper is different than it was when printing with the 
  202. typesetter's standard configuration.  If there appears to be no difference, 
  203. or if the typesetter issues an error message, or if there is simply no 
  204. output, you should first check that you have set the paper size in the 
  205. printer configuration window, and also double-check your changes to 
  206. PSProlog2.
  207.  
  208. If the problem persists, or the typesetter produces an error message when it 
  209. encounters the setpageparams command, it is likely that the typesetter does 
  210. not support this command.  If this is the case, consult your bureau or 
  211. typesetter documentation to determine what equivalent commands are available. 
  212.  Put the correct commands in place of the setpageparams command.  Another 
  213. possibility is that your page size exceeds the device's capability.  Consult 
  214. the typesetter's documentation for the range of valid parameters to 
  215. setpageparams.
  216.  
  217.  
  218.  
  219.  
  220.  
  221.  
  222. There follows a non-exhaustive list of devices that support setpageparams.
  223.  
  224. AGFA-AccuSet                             Linotronic 200 v49.3
  225. AGFA-AccuSetSF                           Linotronic 200_230
  226. AGFA-ProSet9400                          Linotronic 260
  227. AGFA-ProSet9400SF                        Linotronic 300 v47.1
  228. AGFA-ProSet9550                          Linotronic 300 v49.3
  229. AGFA-ProSet9550SF                        Linotronic 300 v52.3
  230. AGFA-ProSet9600                          Linotronic 330
  231. AGFA-ProSet9600SF                        Linotronic 500 v49.3
  232. AGFA-ProSet9700                          Linotronic 500 v52.3
  233. AGFA-ProSet9700SF                        Linotronic 530
  234. AGFA-ProSet9800                          Linotronic 630_630P
  235. AGFA-ProSet9800SF                        Linotronic 830
  236. AGFA-SelectSet5000                       Linotronic 930
  237. AGFA-SelectSet5000SF                     Linotronic Pr60
  238. AGFA-SelectSet7000                       Scantext 2030-51
  239. AGFA-SelectSet7000SF                     Varityper 4000/5100A
  240. AGFA-StudioSet2000                       Varityper 4000/5300A
  241. Agfa-Compugraphic 9400P                  Varityper 4000/5300B
  242. Autologic APS-1000 v52.3                 Varityper 4000/5300C
  243. Autologic APS-1560 v52.3                 Varityper 4000/5300EA
  244. Autologic APS-4000 v52.3                 Varityper 4000/5300EB
  245. Autologic APS-5000 v52.3                 Varityper 4000/5300EC
  246. Autologic APS-6/108c v52.3               Varityper 4000/5330A
  247. Autologic APS-6/108ch v52.3              Varityper 4000/5330B
  248. Autologic APS-6/108chs v52.3             Varityper 4000/5330C
  249. Autologic APS-6/108h                     Varityper 4000/5500A
  250. Autologic APS-6/108hs                    Varityper 4000/5500B
  251. Autologic APS-6/70 v52.3                 Varityper 4000/5500C
  252. Autologic APS-6/70c v52.3                Varityper 4000/5510
  253. Autologic APS-6/70ch v52.3               Varityper 4000/5630A
  254. Autologic APS-6/70chs v52.3              Varityper 4000/5630B
  255. Autologic APS-6/70vr v52.3               Varityper 4000/5660
  256. Autologic APS-6/80 v52.3                 Varityper 4000/5860
  257. Autologic APS-6/84c v52.3                Varityper 4000/L300
  258. Autologic APS-6000 v52.3                 Varityper 4000/L330
  259. Autologic APS-6600 v52.3                 Varityper 4000/L500
  260. Autologic APS-7000 v52.3                 Varityper 4000/L530
  261. Autologic APS-9800 v52.3                 Varityper 4990
  262. Autologic APS-AccuSet v52.3              Varityper 4990T
  263. Autologic APS-BroadSheet Imager v52.3    Varityper 5100E
  264. Autologic APS-ColorMaster v52.3          Varityper 5100E
  265. Autologic APS-PlateMaster v52.3          Varityper 5660E
  266. Autologic APS-ProSet v52.3               Varityper 5860E
  267. Autologic LZR-1200 v52.3                 Varityper 5960E
  268. Autologic LZR-2600 v52.3                 Varityper 6000
  269. Linotronic 100                           Varityper 6990
  270. Linotronic 200
  271.  
  272. Method 2: setpagedevice
  273.  
  274. Level 2 PostScript supports the setpagedevice command which, among other 
  275. things, can be used to specify a custom page size.  If you are unsure 
  276. whether your device supports Level 2 PostScript, consult the typesetter's 
  277. documentation, your bureau or the typesetter manufacturer.
  278.  
  279. Add the following lines to the end of PSProlog2, replacing "a4extra" with 
  280. your chosen name:-
  281.  
  282. % A4 with space for crop marks, for devices supporting setpagedevice
  283. /a4extra {
  284.   4 dict dup begin
  285.     /PageSize [652 899] def
  286.     /Orientation 0 def
  287.     /ImagingBBox null def
  288.     /Policies 1 dict dup begin /PageSize 4 def end def
  289.   end setpagedevice
  290. } def
  291.  
  292. /PageSize [652 899] determines the size of the page.  Replace the numbers 
  293. in the square brackets with the width and height of your custom page size 
  294. measured in points; to convert from millimetres to points, multiply by 2.835. 
  295.  
  296. The setpagedevice command attempts to orient your custom page on the 
  297. physical medium so that the shorter side of the custom page size lies along 
  298. the shorter side of the medium.  To select the other orientation change the 
  299. /Orientation setting to 1, but do not alter the width and height settings.  
  300. The relationship between the image and the page size remains the same, so 
  301. this is not a way of achieving "landscape" printing.  If the device is unable 
  302. to honour your orientation setting it may ignore it.
  303.  
  304. The /ImagingBBox and /Policies lines should be copied verbatim from the 
  305. example and not altered except on the explicit advice of your bureau.
  306.  
  307. Having modified and saved the file, test it by sending a one-page printout 
  308. to the device.  If all is well, you should observe that the position of the 
  309. image on the paper is different than it was when printing with the 
  310. typesetter's standard configuration.  If there appears to be no difference, 
  311. or if the typesetter issues an error message, or if there is simply no 
  312. output, you should first check that you have set the paper size in the 
  313. printer configuration window, and also double-check your changes to PSProlog2.
  314.  
  315. If the problem persists, or the typesetter produces an error message when it 
  316. encounters the setpagedevice command, it is likely that the requested page 
  317. size is outside the legal range for the device.  If so, consult your bureau 
  318. or typesetter documentation to determine what the allowed sizes are.
  319.  
  320. Note: the exact effect of the setpagedevice command cannot be guaranteed to 
  321. be consistent across different devices.  The range of legal PageSize values 
  322. and the policy used when choosing how to fit the requested page size onto 
  323. the available media are device dependent, and to some extent installation 
  324. dependent.  Consult your typesetter documentation, your bureau or the 
  325. typesetter manufacturer if you encounter difficulties.
  326.  
  327.