home *** CD-ROM | disk | FTP | other *** search
/ Meeting Pearls 1 / Meeting Pearls Vol 1 (1994).iso / installed_progs / text / faqs / postscript.faq.part7-10 < prev    next >
Encoding:
Internet Message Format  |  1994-04-13  |  32.0 KB

  1. Subject: PostScript monthly FAQ v2.2 12-26-93 [07-10 of 11]
  2. Newsgroups: comp.lang.postscript,comp.answers,news.answers
  3. From: Jonathan Monsarrat <postscript-request@cs.brown.edu>
  4. Date: Tue, 12 Apr 1994 04:46:03 GMT
  5.  
  6. Archive-name: postscript/faq/part7-10
  7. Last-modified: 1993/12/26
  8. Version: 2.2
  9.  
  10.                               -- PostScript -- 
  11.  
  12.                             Answers to Questions 
  13.  
  14.                     (the comp.lang.postscript FAQ v2.2) 
  15.  
  16.                                Jon Monsarrat 
  17.  
  18.                               jgm@cs.brown.edu 
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.                      This FAQ is formatted as a digest. 
  26.  
  27.                 Most news readers can skip from one question 
  28.  
  29.                      to the next by pressing control-G. 
  30.  
  31.  
  32.     Changes since the last version are marked with a '|' in the table 
  33.     of contents and in the sections in the text-only format of the FAQ. 
  34.  
  35.     Now that there is Linux and NetBSD and BSD 386 UNIX IBM PC (and 
  36.     clone) users can run any of the X-windows and UNIX programs in the 
  37.     utilities section. See comp.os.linux. Also, there is now 
  38.     GhostScript for the Macintosh. 
  39.  
  40.     Many thanks to Dan Carrigan for reformatting the books and 
  41.     publishers section. 
  42.  
  43.     The utilities index from the comp.sources.postscript FAQ will be 
  44.     posted in comp.lang.postscript now too. 
  45.  
  46.     Please help fix the FAQ! All comments should be mailed to 
  47.     jgm@cs.brown.edu. My favorite way to receive a change suggestion is 
  48.     when it is accompanied by a section of the FAQ that is edited and 
  49.     mailed to me verbatim as an example. If you would like to 
  50.     contribute, please read the section ``about the FAQ'' first. Thank 
  51.     you! 
  52.  
  53.     Books and programs are referred to by name only. See the book 
  54.     sections for book information, and the comp.sources.postscript FAQ 
  55.     for a full list of all PostScript related programs. I have archived 
  56.     a number of the small utilities in 
  57.     wilma.cs.brown.edu:pub/postscript. You can get the 
  58.     comp.sources.postscript FAQ from 
  59.     wilma.cs.brown.edu:pub/comp.sources.postscript. 
  60.  
  61.     Related FAQs: comp.text, comp.text.tex, comp.fonts, comp.graphics, 
  62.     comp.sys.mac.apps, comp.sources.postscript. 
  63.  
  64. Subject: 7 Programming in PostScript 
  65.  
  66.  
  67. Subject: 7.1 What is PostScript level 2? 
  68.  
  69.     (See the Section 11, ``About PostScript 2''.) 
  70.  
  71.  
  72. Subject: 7.2 Should I learn level 2 PostScript? 
  73.  
  74.     Yes, because Level Two will soon become the standard. Application 
  75.     developers using PostScript need to become aware of the new 
  76.     capabilities and how to take advantage of them. 
  77.  
  78.     There are many good books on PostScript 2. (See Section 5, 
  79.     ``Books''.) 
  80.  
  81.  
  82. Subject: 7.3 Where can I find examples of PostScript code? 
  83.  
  84.     Many other books on PostScript make example PostScript code 
  85.     available. ``Thinking in PostScript'', by Glenn Reid, is the only 
  86.     book I know of that allows its examples to be freely distributed. 
  87.     (See Section 5, ``Books''.) 
  88.  
  89.     All the examples in ``the blue book'' are available from the Adobe 
  90.     file server (See Section 5, ``Books''.) 
  91.  
  92.     See the question ``How can I browse through PostScript programs?'' 
  93.     in the comp.sources.postscript FAQ. 
  94.  
  95.  
  96. Subject: 7.4 What is the physical size of the page? 
  97.  
  98. |   This depends on what print medium you are using. Paper comes in a 
  99. |   number of standard sizes: 
  100. |
  101. |  
  102. |         Paper Size                      Dimension (in points)
  103. |         ------------------------------  ---------------------
  104. |         Comm #10 Envelope               297 x 684
  105. |         C5 Envelope                     461 x 648
  106. |         DL Envelope                     312 x 624
  107. |         Folio                           595 x 935
  108. |         Executive                       522 x 756
  109. |         Letter                          612 x 792
  110. |         Legal                           612 x 1008
  111. |         Ledger                          1224 x 792
  112. |         Tabloid                         792 x 1224
  113. |         A0                              2384 x 3370
  114. |         A1                              1684 x 2384
  115. |         A2                              1191 x 1684
  116. |         A3                              842 x 1191
  117. |         A4                              595 x 842
  118. |         A5                              420 x 595
  119. |         A6                              297 x 420
  120. |         A7                              210 x 297
  121. |         A8                              148 x 210
  122. |         A9                              105 x 148
  123. |         B0                              2920 x 4127
  124. |         B1                              2064 x 2920
  125. |         B2                              1460 x 2064
  126. |         B3                              1032 x 1460
  127. |         B4                              729 x 1032
  128. |         B5                              516 x 729
  129. |         B6                              363 x 516
  130. |         B7                              258 x 363
  131. |         B8                              181 x 258
  132. |         B9                              127 x 181 
  133. |         B10                             91 x 127
  134. |  
  135. |   To determine what print mediums are available, check the PPD file 
  136. |   for your printer, under the PageSize keyword. 
  137.  
  138.  
  139. Subject: 7.5 What is the Imagable Area of the page 
  140.  
  141. |   The initial clipping path gives you the size of the imagable area. 
  142. |   Use ``clippath pathbbox'' to get these coordinates. If you must 
  143. |   know the size of the device's imageable area, use the sequence 
  144. |   ``gsave initclip clippath pathbbox grestore'', but this will 
  145. |   prevent an enclosing application from using the clippath to achieve 
  146. |   some special effects (such as multiple pages per page). 
  147. |
  148. |   PPD files (see section 2 of the FAQ, printers) contain information 
  149. |   on what paper sizes, as well as the Imagable Area for each, 
  150. |   specific to each printer. A Postscript code fragment (called 
  151. |   ``?ImageableArea'') is described in a PPD file, which determines 
  152. |   the current Imageable Area for that printer. 
  153.  
  154.  
  155. Subject: 7.6 Why can't I do a pathforall after a charpath ? 
  156.  
  157.     (See Section 4, ``Fonts'', question ``Why are Adobe fonts 
  158.     hidden?''.) 
  159.  
  160.  
  161. Subject: 7.7 How do I center a string of text around a point? 
  162.  
  163.     Level 1 PostScript has two operators that can extract information 
  164.     about the metrics of characters: ``stringwidth'' and ``charpath''. 
  165.  
  166.     The ``stringwidth'' operator returns the advance width of its 
  167.     string operand. This is the distance the current point would be 
  168.     moved by a ``show'' operation on the same string. ``stringwidth'' 
  169.     returns two numbers on the stack, representing the x and y 
  170.     components of the advance width. Usually the y component is zero 
  171.     because most fonts are displayed along a horizontal line, moving 
  172.     the current point only in the x direction. 
  173.  
  174.     Also note that the ``stringwidth'' usually does not give an exact 
  175.     measure of the area of the page that will be touched by its 
  176.     operand. The letters can either project a little over the 
  177.     boundaries or fall a little within (leaving a touch of whitespace). 
  178.  
  179.     If all that an application requires is horizontal centering of a 
  180.     long string of text, the result returned by ``stringwidth'' is 
  181.     sufficient. A common technique is 
  182.  
  183.   
  184.           x y moveto
  185.           (string) dup stringwidth pop 2 div neg 0 rmoveto show
  186.   
  187.     (This code makes the assumption that the y component of advance 
  188.     width is irrelevant.) 
  189.  
  190.     The ``charpath'' operator extracts the graphic shapes of its string 
  191.     operand and appends them to the current path in the graphic state. 
  192.     These shapes can then be processed by other PostScript operators. 
  193.     To get the actual size of the area touched by a character a simple 
  194.     approach is 
  195.  
  196.   
  197.           gsave
  198.           newpath
  199.           0 0 moveto
  200.           (X) false charpath flattenpath pathbbox
  201.           grestore
  202.   
  203.     This code places four numbers on the stack, representing the 
  204.     coordinates of the lower left and upper right corners of the 
  205.     bounding box enclosing the character ``X'' rendered with the 
  206.     current point at (0,0). Leaving the flattenpath out will cause it 
  207.     to be less accurate, but it will take up less memory and be faster. 
  208.  
  209.     There are two things to be careful about when using the code shown 
  210.     above: 
  211.  
  212.  
  213.  
  214.    1. There are severe limits on the size of the string operand, 
  215.       related to the limit on the number of elements in a graphic path. 
  216.       The PostScript Language Reference Manual recommends taking 
  217.       ``charpath''s one character at a time. 
  218.  
  219.  
  220.    2. If user space is rotated or skewed with respect to device space, 
  221.       the result from ``pathbbox'' may be larger than expected; 
  222.       ``pathbbox'' returns a rectangle oriented along the user space 
  223.       coordinate axes, which fully encloses a (possibly smaller) 
  224.       rectangle oriented along the coordinate axes of device space. If 
  225.       user space is rotated at an integer multiple of 90 degrees these 
  226.       two rectangles will be the same, otherwise the rectangle in user 
  227.       space will be larger. 
  228.  
  229.     So, to center text vertically one must get the bounding boxes of 
  230.     all the characters in the string to be displayed, find the minimum 
  231.     and maximum y coordinate values, and use half the distance between 
  232.     them to displace the text vertically. This still may not do a very 
  233.     good job, since this provides centering based on extrema, not on 
  234.     the optical center of the string (which is more related to a sort 
  235.     of ``center of mass'' of the text). 
  236.  
  237.     If an application does this repeatedly, it would be wise to store 
  238.     the bounding boxes in an array indexed by character code, since 
  239.     ``charpath'' is a slow operation. 
  240.  
  241.     Font metric information is available outside of a PostScript 
  242.     printer in font metrics files, available from the font vendor. A 
  243.     program generating PostScript output can obtain metrics from these 
  244.     files rather than extracting the metrics in the printer. 
  245.  
  246.  
  247. Subject: 7.8 How can I concatenate two strings together? 
  248.  
  249.   
  250.   %% string1 string2 append string
  251.   % Function: Concatenates two strings together.
  252.   /append {
  253.            2 copy length exch length add  % find the length of the new.
  254.            string dup     % string1 string2 string string
  255.            4 2 roll       % string string string1 string2
  256.            2 index 0 3 index
  257.            % string string string1 string2 string 0 string1
  258.            putinterval    % stuff the first string in.
  259.            % string string string1 string2
  260.            exch length exch putinterval
  261.   } bind def
  262.   
  263.  
  264. Subject: 7.9 What do I do when I get stack overflow/underflow? 
  265.  
  266.     These errors are among the most common in PostScript. 
  267.  
  268.     When I get a stack overflow, that is usually a sign that a routine 
  269.     is leaving an object on the stack. If this routine gets called 2000 
  270.     times, it leaves 2000 objects on the stack, which is too many. 
  271.  
  272.     When I get a stack underflow, that is a sign that either: (A) one 
  273.     of the routines in the program doesn't work, and never has or (B) 
  274.     one of the routines in the program works, but expects to be called 
  275.     with some arguments left on the stack. 
  276.  
  277.     There is no such thing as a PostScript debugger right now. For now, 
  278.     the best that you can do to debug your program is to put in lots of 
  279.     print statements. Learn to use the PostScript pstack command, and 
  280.     use an online interpreter so you don't have to run to the printer 
  281.     for each debugging cycle. 
  282.  
  283.     Use an error handler to learn more about what exactly is happening 
  284.     when your program crashes. (see the comp.sources.postscript FAQ for 
  285.     a list of all PostScript related programs.) 
  286.  
  287.     If your code has never worked yet (i.e. you are still writing it) 
  288.     then I find that it helps to put little comments in the margin 
  289.     about the state of the stack. Like this: 
  290.  
  291.   
  292.          Heart pathbbox             % lowerx lowery upperx uppery
  293.          exch 4 -1 roll             % lowery uppery upperx lowerx
  294.   
  295.   
  296.     I generally put these comments in originally, and then take them 
  297.     out when the program works. Maybe this is a bad practice, in case I 
  298.     ever want to go back and look at the code to modify it!! 
  299.  
  300.  
  301. Subject: 7.10 How can I print in landscape mode? 
  302.  
  303.     Landscape (the opposite of portrait) means that the page is turned 
  304.     on its side. You can redefine showpage in terms of the current 
  305.     definition of showpage. 
  306.  
  307.     Do something like: 
  308.  
  309.   
  310.   /oldshowpage /showpage load def
  311.   
  312.   90 rotate llx neg ury neg translate   % for the first page
  313.   /showpage
  314.   {
  315.           oldshowpage
  316.           90 rotate llx neg ury neg translate
  317.   } def
  318.   
  319.     This won't work if the PostScript file you're editing uses 
  320.     initgraphics or grestoreall. Also note that the method described 
  321.     (redefining showpage) does not conform to the document structuring 
  322.     conventions. The Adobe recommended method involves performing the 
  323.     transformaton as part of the setup for each page. 
  324.  
  325.  
  326. Subject: 8 Computer-specific PostScript 
  327.  
  328.     This section describes PostScript information specific to a 
  329.     particular type of computer or operating system. 
  330.  
  331.  
  332. Subject: 8.1 Sun Workstations 
  333.  
  334.     What is NeWS? 
  335.  
  336. |   NeWS (R.I.P.) was Sun Microsystems PostScript-based window system 
  337. |   for the Sun Workstation. NeWS was a project within Sun (started 
  338. |   around 1985) to create a window system to supplant SunView (a very 
  339. |   successful kernel-based window system). NeWS was a client-server 
  340. |   model window system (like X) but among many of NeWS novel features 
  341. |   was the use of PostScript as the language to describe the 
  342. |   appearance of objects on the screen. NeWS had many features in 
  343. |   common with Display PostScript, but NeWS predates Adobe Display 
  344. |   PostScript and was neither connected with Adobe Display PostScript 
  345. |   nor endorsed by Adobe. NeWS was not an Adobe product, nor was it a 
  346. |   Sun/Adobe joint venture. 
  347. |
  348. |   As of October 1992, Sun management signed a deal with Adobe to 
  349. |   adopt Display PostScript for the Sun. In 1993, Sun finally dropped 
  350. |   NeWS altogether. The Sun window system is supposed to start 
  351. |   shipping a Display PostScript environment in late 1993. 
  352.  
  353.     And how does PostScript run on them? 
  354.  
  355.     PostScript runs on NeWS, although NeWS was not a fully-compliant 
  356.     PostScript interpreter. There were incompatibilities between the 
  357.     NeWS PostScript interpreter and ``official'' PostScript 
  358.     interpreters as defined by Adobe and the Apple LaserWriter family 
  359.     of printers, such that many PostScript files which would print fine 
  360.     on a LaserWriter would not render under NeWS. The most critical 
  361.     incompatibility was lack of support for Adobe Type 1 fonts, Sun 
  362. |   having gone with their own font format known as F3. F3 fonts have 
  363. |   now gone the way of the zumbooruk and will be supplanted by Type 1 
  364. |   fonts. 
  365.  
  366.  
  367. Subject: 8.2 IBM PC 
  368.  
  369.     You can find nenscript for OS/2 1.x--2.0 and MSDOS on 
  370.     ftp-os2.nmsu.edu in pub/uploads/nensc113.zip. 
  371.  
  372.     There are rumors that Word Perfect and Microsoft Word don't produce 
  373.     ``clean'' PostScript that follows the DSC conventions (See Section 
  374.     9, ``Encapsulated PostScript''). This means that a lot of 
  375.     PostScript utilities like Ghostview and psnup, etc., that require 
  376.     the DSC conventions, will not work on them. 
  377.  
  378.     Creating a PostScript file from MS Word 
  379.  
  380.     Install the LaserWriter driver that comes with Windows.In the 
  381.     printer setup, select a PostScript printer. Then click on the setup 
  382.     button to get that pop-up. Then clik the Options button. Then 
  383.     select the print to Encapsulated PostScript File. If you don't 
  384.     specify a file name, Word will prompt you for one when you tell it 
  385.     to print. 
  386.  
  387.     When printing Microsoft Windows files that have been captured on a 
  388.     PC's LPT port, you mostly need to define two ctrl-d's in a row as 
  389.     well to remove all of them in the document: 
  390.  
  391.   
  392.   (\004\004) cvn {} def
  393.   
  394.  
  395. Subject: 8.3 Apple Macintosh 
  396.  
  397.     For more details about printing with the Macintosh, read the 
  398.     comp.sys.mac.apps FAQ. 
  399.  
  400.     How can I convert a PostScript file created with a UNIX program to 
  401.     the Mac? 
  402.  
  403.     A way that is clumsy, but works, is this: 
  404.  
  405.  
  406.  
  407.    1. Display the UNIX-based PostScript file on screen 
  408.  
  409.  
  410.    2. Use window dumping facility to get a bitmap file 
  411.  
  412.  
  413.    3. Convert the above bitmap file to TIFF format and then export it 
  414.       to Adobe Illustrator on the Mac. 
  415.  
  416.     The PostScript section of the FAQ for the Macintosh newsgroup 
  417.     comp.sys.mac.apps (maintained by Elliotte Harold) answers the 
  418.     following questions: 
  419.  
  420.  
  421.  
  422.     * How do I make a PostScript file? 
  423.  
  424.  
  425.     * How do I print a PostScript file? 
  426.  
  427.  
  428.     * Why won't my PostScript file print on my mainframe's printer? 
  429.  
  430.       Full documentation of this process provided with a utility called 
  431.       macps. 
  432.  
  433.  
  434.     * Why are my PostScript files so big? 
  435.  
  436.  
  437. Subject: 9 Encapsulated PostScript 
  438.  
  439.  
  440. Subject: 9.1 What is Encapsulated PostScript? 
  441.  
  442.     Encapsulated PostScript (EPS) is a standard format for importing 
  443.     and exporting PostScript language files in all environments. It is 
  444.     usually a single page PostScript language program that describes an 
  445.     illustration. The purpose of the EPS file is to be included as an 
  446.     illustration in other PostScript language page descriptions. The 
  447.     EPS file can contain any combination of text, graphics, and images. 
  448.     An EPS file is the same as any other PostScript language page 
  449.     description, with some restrictions. 
  450.  
  451.     EPS files can optionally contain a bitmapped image preview, so that 
  452.     systems that can't render PostScript directly can at least display 
  453.     a crude representation of what the graphic will look like. There 
  454.     are three preview formats: Mac (PICT), IBM (tiff), and a platform 
  455.     independent preview called EPSI. 
  456.  
  457.     An EPS file must be a conforming file, that is, it must conform to 
  458.     the Adobe Document Structuring Conventions (DSC). At a minimum, it 
  459.     must include a header comment,%!PS-Adobe-3.0 EPSF-3.0, and a 
  460.     bounding box comment,%%BoundingBox: llx lly urx ury, that 
  461.     describes the bounds of the illustration. 
  462.  
  463.     (The specification does not require the EPSF version, but many 
  464.     programs will reject a file that does not have it.) 
  465.  
  466.     The EPS program must not use operators that initialize or 
  467.     permanently change the state of the machine in a manner that cannot 
  468.     be undone by the enclosing application's use of save and restore 
  469.     (eg. the operators starting with ``init'' like initgraphics). As a 
  470.     special case, the EPS program may use the showpage operator. The 
  471.     importing application is responsible for disabling the normal 
  472.     effects of showpage. 
  473.  
  474.     The EPS program should make no environment-sensitive decisions (the 
  475.     importing application may be trying to attain some special effect, 
  476.     and the EPS program shouldn't screw this up), although it can use 
  477.     some device-dependent tricks to improve appearance such as a 
  478.     snap-to-pixel algorithm. 
  479.  
  480.     The complete EPS specification is available from Adobe (see the 
  481.     section on Adobe). Read Appendix G (Document Structuring 
  482.     Conventions, V3.0) and Appendix H (Encapsulated PostScript File 
  483.     Format, V3.0) in the new PostScript red book: PostScript Language 
  484.     Reference Manual, Second Edition. 
  485.  
  486.     An optional component of an EPS file is a ``preview'' image of the 
  487.     file's content. The preview image is a bitmapped representation of 
  488.     the image which may be displayed by programs using the EPS file 
  489.     without having to actually interpret the PostScript code. 
  490.  
  491.     The recommended form for a preview image is ``Interchange'' format 
  492.     and is described fully in the ``red book'', second edition. 
  493.     Interchange format represents the image as a series of hex strings 
  494.     placed in the EPS file as PostScript comments. The entire file 
  495.     remains an ASCII file. 
  496.  
  497.     That book contains all of the information that you need to fix your 
  498.     program to correctly output EPS. It is what I use for our software. 
  499.  
  500.     A variation of EPS embeds the preview image and PostScript text in 
  501.     a binary file which contains a header and the preview image in 
  502.     either a TIFF or MetaFile format. The header defines where in the 
  503.     file each section (EPS, TIFF, or MetaFile) starts and ends. On the 
  504.     Macintosh, the preview is stored as a PICT in the file's resource 
  505.     fork. 
  506.  
  507.  
  508. Subject: 9.2 What are EPSI and EPSF? 
  509.  
  510.     EPSI is EPS with a device independent bitmap preview. EPSI is an 
  511.     all ASCII (no binary data or headers) version of EPS. EPSI provides 
  512.     for a hexadecimal encoded preview representation of the image that 
  513.     will be displayed or printed. 
  514.  
  515.     EPSF is a version of EPS with a TIFF preview instead of a bitmap 
  516.     preview. 
  517.  
  518.  
  519. Subject: 9.3 How do I convert PostScript to EPS? 
  520.  
  521.     Use pstoepsi, or do it by hand. 
  522.  
  523.     To convert from PostScript to EPS, one must guarantee that the 
  524.     PostScript file meets the above requirements. If the actual program 
  525.     conforms to the programming requirements, then one can simply add 
  526.     the required comments at the top of the file saying that the file 
  527.     is EPS and giving its BoundingBox dimensions. 
  528.  
  529.     Optional comments include font usage (%%DocumentFonts: or%% 
  530.     DocumentNeededResources: font), EPSI preview comments (%% 
  531.     Begin(End)Preview:) extensions (%%Extensions:) and language 
  532.     level (%%LanguageLevel:). 
  533.  
  534.     There are some operators that should not be used within an EPS 
  535.     file: 
  536.  
  537.   
  538.           banddevice     cleardictstack   copypage     erasepage
  539.           exitserver     framedevice      grestoreall  initclip
  540.           initgraphics   initmatrix       quit         renderbands
  541.           setglobal      setpagedevice    setshared    startjob
  542.   
  543.     These also include operators from statusdict and userdict operators 
  544.     like legal, letter, a4, b5, etc. 
  545.  
  546.     There are some operators that should be carefully used: 
  547.   
  548.           nulldevice     setgstate        sethalftone  setmatrix
  549.           setscreen      settransfer      undefinefont
  550.   
  551.     To convert a PostScript file to EPS format, you must edit the file 
  552.     using a text editor or word processor to add lines that will define 
  553.     the file as an EPS-format file. 
  554.  
  555.  
  556.  
  557.    1. Using your normal method of printing, print the PostScript file 
  558.       to a PostScript printer. You can choose to view it on the screen 
  559.       instead, but keep in mind that all the below distance 
  560.       measurements assume that you are printing on a normal-sized piece 
  561.       of paper. 
  562.  
  563.       NOTE: If the PostScript image does not get displayed properly, it 
  564.       probably will not work either once you have converted it to EPS 
  565.       format. Correct the PostScript program so that it works before 
  566.       you convert it to EPS format. 
  567.  
  568.  
  569.    2. Use a tool (see below) to find the bounding box, which shows how 
  570.       much space the PostScript image occupies when printed. You 
  571.       specify the dimensions of the bounding box when you convert the 
  572.       PostScript file to EPS format. 
  573.  
  574.  
  575.    3. If you don't have a bounding box tool, you can just use a ruler 
  576.       and draw one on your printout. With two horizontal lines and two 
  577.       vertical lines, draw a box around the image that includes the 
  578.       entire image while minimizing white space. 
  579.  
  580.       This box represents your bounding box. You may want to leave a 
  581.       small amount of white space around the image as a precautionary 
  582.       measure against minor printing problems, such as paper stretching 
  583.       and paper skewing. 
  584.  
  585.  
  586.    4. Measure distance ``a'' from the lower-left corner of the image to 
  587.       the left edge of the paper. 
  588.  
  589.  
  590.    5. Write the measurement in points. If your ruler does not show 
  591.       points, calculate the total number of points: 1 inch = 72 points, 
  592.       1 cm = 28.3 points, and 1 pica = 12 points. Designate this 
  593.       measurement as ``measurement a.'' 
  594.  
  595.  
  596.    6. Measure distance ``b'' from the lower-left corner of the image to 
  597.       the bottom edge of the paper. 
  598.  
  599.       Designate this measurement in points as ``measurement b.'' 
  600.  
  601.  
  602.    7. Measure distance ``c'' from the upper-right corner of the image 
  603.       to the left edge of the paper. 
  604.  
  605.       Designate this measurement in points as ``measurement c.'' 
  606.  
  607.  
  608.    8. Measure distance ``d' from the upper-right corner of the image to 
  609.       the bottom edge of the paper. 
  610.  
  611.       Designate this measurement in points as ``measurement d.'' 
  612.  
  613.  
  614.    9. Using any text editor, open the PostScript file for editing. 
  615.  
  616.       You'll see several lines of text. These lines are the PostScript 
  617.       description of the image. The lines at the top of the file are 
  618.       the header. 
  619.  
  620.  
  621.   10. Add these lines to, or modify existing lines in, the header (the 
  622.       first group of lines in any PostScript file): 
  623.  
  624.     
  625.             %!Adobe-2.0 EPSF
  626.             %%Creator: name
  627.             %%CreationDate: date
  628.             %%Title: filename
  629.             %%BoundingBox: a b c d
  630.     
  631.  
  632.       Note: Make sure that the first line in the file is ``% 
  633.       !Adobe-2.0 EPSF.'' Also, do not separate the header lines with a 
  634.       blank line space. The first blank line that PostScript encounters 
  635.       tells it that the the next line begins the body of the program. 
  636.  
  637.       For ``name,'' type your name or initials. For ``date,'' type 
  638.       today's date using any format (for example, MM-DD-YY, MM/DD/YY, 
  639.       July 5, 1987, and so on). For ``filename,'' type the name of the 
  640.       PostScript file. After ``BoundingBox: ,'' type the measurements 
  641.       you took in steps 3, 4, 5, and 6, separating each with a space: 
  642.       ``a'' is the measurement from Step 3, ``b'' is the measurement 
  643.       from Step 4, ``c'' is the measurement from Step 5, and ``d'' is 
  644.       the measurement from Step 6. 
  645.  
  646.  
  647.   11. Save the file in text-only format. 
  648.  
  649.     If you are interested in learning how to further edit your 
  650.     PostScript files, these books are available at most bookstores: 
  651.  
  652.     Understanding PostScript Programming and the green book. 
  653.  
  654.     The Document Structuring Conventions (DSC), version 1.0, are 
  655.     discussed in Appendix C of the old red book. The new red book has a 
  656.     lot of information about Encapsulated PostScript. 
  657.  
  658.     There will be a technical note available from Adobe called 
  659.     ``Guidelines for Specific Operators'' that will talk about why some 
  660.     operators are prohibited and how to use the others. 
  661.  
  662.  
  663. Subject: 9.4 How do I get the bounding box of a PostScript picture? 
  664.  
  665.     Use bbfig or epsinfo.ps. 
  666.  
  667.     Or if you would rather construct the bounding box by hand, use 
  668.     Ghostview, which has a continuous readout of the mouse cursor in 
  669.     the default user coordinate system. You simply place the mouse in 
  670.     the corners of the figure and read off the coordinates. 
  671.  
  672. Subject: 10 About The Comp.Lang.PostScript FAQ (and Usenet Guide to 
  673.     PostScript) 
  674.  
  675.  
  676. Subject: 10.1 The PostScript FAQ: What is it? 
  677.  
  678.     The PostScript FAQ is a set of answers to frequently asked 
  679.     questions (FAQs) that have appeared on the Usenet newsgroup 
  680.     comp.lang.postscript. It is broken into many useful sections. 
  681.  
  682.     The Usenet Guide to PostScript is a larger set of help and answers 
  683.     to PostScript questions, plus a tutorial for new users. It is still 
  684.     in the process of being created. There is one file ``Exactly What 
  685.     Does a Transformation Matrix Do?'', that is definitely not part of 
  686.     the FAQ. Please send more! 
  687.  
  688.     I need help writing and revising answers for common questions 
  689.     relating to PostScript. Almost all of the information in the 
  690.     documents has been written by kind volunteers. The answers will be 
  691.     published in either or both documents. A very long answer in the 
  692.     Usenet Guide may be summarized, referred to briefly, or not 
  693.     mentioned at all in the FAQ. 
  694.  
  695.  
  696. Subject: 10.2 How to get the FAQ files 
  697.  
  698.     The FAQ is available by anonymous ftp to 
  699.     wilma.cs.brown.edu:pub/comp.lang.postscript/ You can get it 
  700.     formatted in plain text ASCII, LaTeX, or PostScript. 
  701.  
  702.     I would be happy to email a copy of the FAQ in any format to you if 
  703.     you do not have FTP. 
  704.  
  705.  
  706. Subject: 10.3 How to write a FAQ answer 
  707.  
  708.     I greatly appreciate your time and effort to help improve the 
  709.     quality of the FAQ. Thank you for being willing to contribute! 
  710.  
  711.  
  712.     * Please check to see if the topic is already in an FAQ. Perhaps 
  713.       you really mean to submit a revision to an existing section. 
  714.  
  715.     * Start with a clear statement about what problem you are solving. 
  716.  
  717.     * Write for novice users, in ``tutorial format'', even if the 
  718.       answer is meant for experienced programmers. 
  719.  
  720.     * Be specific when you make references. 
  721.  
  722.     * Be complete, and take the time to look over your draft and 
  723.       revise. 
  724.  
  725.     * Answers should not be too wordy, unless you intend to write a 
  726.       long answer for the Usenet Guide and have a shorter summary or a 
  727.       pointer to the description placed in the FAQ. If you want to 
  728.       write the summary yourself, thanks! 
  729.  
  730.     * Obviously, I cannot accept copyrighted material without 
  731.       permission. Don't write the FAQ by paraphrasing from a 
  732.       copyrighted book! 
  733.  
  734.  
  735. Subject: 10.4 The FAQ can contain LaTeX and PostScript inserts 
  736.  
  737.     The FAQ is actually written with LaTeX, so feel free to submit with 
  738.     that text formatting language. There is a PostScript version of the 
  739.     FAQ also, so feel free to send along PostScript pictures to 
  740.     include. 
  741.  
  742.  
  743. Subject: 10.5 Revising the FAQ 
  744.  
  745.     Suggestions and comments are welcomed. My favorite way of receiving 
  746.     a change suggestion is if you make a copy of the FAQ, edit the 
  747.     copy, and mail me the modification, or a context diff (include the 
  748.     version number). 
  749.  
  750.  
  751. Subject: 10.6 How to submit new information 
  752.  
  753.     If you know something that you think is worthwhile to be put in a 
  754.     FAQ, definitely send it to me! 
  755.  
  756.     Don't hold back if your information is very specific. If there's 
  757.     too much information to post I will archive it at an ftp site and 
  758.     place a pointer to it in the FAQ. 
  759.  
  760.  
  761. Subject: 10.7 How to add a program description to the FAQ index 
  762.  
  763.     If the program is original, please send it to me, or tell me where 
  764.     I can get it. Please put your name and email address at the top of 
  765.     each file. Your program will be doubly useful if you clean up the 
  766.     program so that other people can use it as an example to learn. 
  767.  
  768.     If the program was written by someone else, please send me just the 
  769.     title, description, and where to get it. I may already have it. 
  770.  
  771.     For programs the FAQ needs to know: 
  772.  
  773.  
  774.     * What is the name of the program? 
  775.  
  776.     * What does it claim to do, and does it do it well? Is it worth 
  777.       using? 
  778.  
  779.     * Where is it available? What ftp sites can I get it from? 
  780.  
  781.     * How much does it cost? Is it free? 
  782.  
  783.     * What kinds of computers does it run on? 
  784.  
  785.     * Who is the author and does the author give an email address? 
  786.  
  787.     * Does it handle PostScript 2? 
  788.  
  789.     * What packages does it rely on? 
  790.  
  791.     If the program is a PostScript interpreter, then the FAQ also needs 
  792.     to know: 
  793.  
  794.  
  795.     * Does it let you go backwards one page? 
  796.  
  797.     * Does it display the number of pages in the document? 
  798.  
  799.     * Does it let you print PostScript to a non-PostScript printer? 
  800.  
  801.     * What formats can it convert to? 
  802.  
  803.  
  804. Subject: 10.8 How to add a book description to the FAQ 
  805.  
  806.     For books the FAQ needs to know: 
  807.  
  808.  
  809.     * What is the name of the book or document? 
  810.  
  811.     * What does it claim to do, and does it do it well? Is it worth 
  812.       using? 
  813.  
  814.     * Can I get it on-line? 
  815.  
  816.     * Who wrote it? Does the author give an email address? 
  817.  
  818.     * Who is the publisher, and what is the copyright date? 
  819.  
  820.     * Does the publisher list an address and phone number or fax 
  821.       number? 
  822.  
  823.     * What is the ISBN number of the book? 
  824.  
  825.     * What is the library call number of the book? 
  826.  
  827.     * How much does the book cost? 
  828.  
  829.     * Does it cover PostScript 2? 
  830.  
  831.     * Are coding examples from the book available by email or anonymous 
  832.       ftp? 
  833.  
  834.     * Do the authors sell the coding examples on a diskette? 
  835.  
  836.  
  837. Subject: 10.9 Questions that need answers 
  838.  
  839.  
  840.  
  841.    1. Where are ftp sites that have PostScript freeware? 
  842.  
  843.  
  844.    2. What vendors sell fonts for PostScript printers? Where are the 
  845.       free ftp sites for them? 
  846.  
  847.  
  848.    3. Are there any free encapsulated PostScript converters? 
  849.  
  850.  
  851.    4. What is the charter for comp.lang.postscript? 
  852.  
  853.  
  854.    5. What questions should the FAQ have? 
  855.  
  856.  
  857.    6. What book information is wrong or missing in the FAQ? 
  858.  
  859.  
  860.    7. What program information is wrong or missing in the FAQ? 
  861.  
  862.  
  863.    8. What ftp site have good examples of PostScript code? 
  864.  
  865.