PostscriptPrinterStream.st
author Claus Gittinger <cg@exept.de>
Mon, 03 Jun 1996 12:02:46 +0200
changeset 378 91abcf70e0c3
parent 375 ab43222a70ce
child 380 fa5adc326473
permissions -rw-r--r--
checkin from browser
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
1cf8d1747859 Initial revision
claus
parents:
diff changeset
     1
"
4
1f66800df351 *** empty log message ***
claus
parents: 2
diff changeset
     2
 COPYRIGHT (c) 1988 by Claus Gittinger
71
claus
parents: 36
diff changeset
     3
	      All Rights Reserved
0
1cf8d1747859 Initial revision
claus
parents:
diff changeset
     4
1cf8d1747859 Initial revision
claus
parents:
diff changeset
     5
 This software is furnished under a license and may be used
1cf8d1747859 Initial revision
claus
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
1cf8d1747859 Initial revision
claus
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
1cf8d1747859 Initial revision
claus
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
1cf8d1747859 Initial revision
claus
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
1cf8d1747859 Initial revision
claus
parents:
diff changeset
    10
 hereby transferred.
1cf8d1747859 Initial revision
claus
parents:
diff changeset
    11
"
1cf8d1747859 Initial revision
claus
parents:
diff changeset
    12
1cf8d1747859 Initial revision
claus
parents:
diff changeset
    13
PrinterStream subclass:#PostscriptPrinterStream
361
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
    14
	instanceVariableNames:'xPos yPos lineBuffer colNr lineNr fFamily fStyle pageStartAction
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
    15
		pageEndAction'
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
    16
	classVariableNames:'Prolog Trailer PageProlog PageTrailer FontNames FontHeight
378
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
    17
		FontWidth LeftX TopY PageHeight LinesPerPage PhysicalPageHeight
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
    18
		Italic Bold Normal BoldItalic Courier Times Helvetica TopInset
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
    19
		LeftInset BottomInset'
186
bc1b056b097c added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents: 179
diff changeset
    20
	poolDictionaries:''
bc1b056b097c added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents: 179
diff changeset
    21
	category:'Streams-External'
0
1cf8d1747859 Initial revision
claus
parents:
diff changeset
    22
!
1cf8d1747859 Initial revision
claus
parents:
diff changeset
    23
6
claus
parents: 4
diff changeset
    24
!PostscriptPrinterStream class methodsFor:'documentation'!
claus
parents: 4
diff changeset
    25
31
e223f3cf2995 *** empty log message ***
claus
parents: 28
diff changeset
    26
copyright
e223f3cf2995 *** empty log message ***
claus
parents: 28
diff changeset
    27
"
e223f3cf2995 *** empty log message ***
claus
parents: 28
diff changeset
    28
 COPYRIGHT (c) 1988 by Claus Gittinger
71
claus
parents: 36
diff changeset
    29
	      All Rights Reserved
31
e223f3cf2995 *** empty log message ***
claus
parents: 28
diff changeset
    30
e223f3cf2995 *** empty log message ***
claus
parents: 28
diff changeset
    31
 This software is furnished under a license and may be used
e223f3cf2995 *** empty log message ***
claus
parents: 28
diff changeset
    32
 only in accordance with the terms of that license and with the
e223f3cf2995 *** empty log message ***
claus
parents: 28
diff changeset
    33
 inclusion of the above copyright notice.   This software may not
e223f3cf2995 *** empty log message ***
claus
parents: 28
diff changeset
    34
 be provided or otherwise made available to, or used by, any
e223f3cf2995 *** empty log message ***
claus
parents: 28
diff changeset
    35
 other person.  No title to or ownership of the software is
e223f3cf2995 *** empty log message ***
claus
parents: 28
diff changeset
    36
 hereby transferred.
e223f3cf2995 *** empty log message ***
claus
parents: 28
diff changeset
    37
"
e223f3cf2995 *** empty log message ***
claus
parents: 28
diff changeset
    38
!
e223f3cf2995 *** empty log message ***
claus
parents: 28
diff changeset
    39
6
claus
parents: 4
diff changeset
    40
documentation
claus
parents: 4
diff changeset
    41
"
28
350f8e9493a4 *** empty log message ***
claus
parents: 10
diff changeset
    42
    This class provides simple text output to postscript printers;
31
e223f3cf2995 *** empty log message ***
claus
parents: 28
diff changeset
    43
    to use it, evaluate 
223
a204fe6b665c commentary & image fixes
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
    44
        Smalltalk at:#Printer put:PostscriptPrinterStream
179
38773360f4b7 more on printing (printerType-query)
Claus Gittinger <cg@exept.de>
parents: 170
diff changeset
    45
    (usually in some rc file).
361
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
    46
    or change it via the launchers settings-menu.
179
38773360f4b7 more on printing (printerType-query)
Claus Gittinger <cg@exept.de>
parents: 170
diff changeset
    47
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
    48
    See examples on how to send something to the printer.
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
    49
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
    50
    For now, only Helvetica, Courier and Times fonts in italic, roman and bold
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
    51
    are supported.
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
    52
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
    53
    It does not directly support graphics and other fancy features of Postscript,
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
    54
    but provides a compatible interface for simple text line-printing 
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
    55
    (see other subclasses of PrinterStream).
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
    56
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
    57
    If you already have a postscript string at hand, this can be sent to
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
    58
    the printer in native mode.
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
    59
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
    60
    To output graphics, you need the PSGraphicsContext (and friend-) classes.
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
    61
    These provide protocol similar to the one provided by display graphicContexts.
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
    62
    Notice, that these postscript classes are derived from public domain code;
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
    63
    there is no warranty.
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
    64
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
    65
    [see also:]
249
869157f95007 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 248
diff changeset
    66
        PSGraphicsContext 
869157f95007 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 248
diff changeset
    67
        EpsonFX1PrinterStream HPLjetIIPrinterStream PrinterStream
259
6d36f3ac42a2 documentation
Claus Gittinger <cg@exept.de>
parents: 249
diff changeset
    68
6d36f3ac42a2 documentation
Claus Gittinger <cg@exept.de>
parents: 249
diff changeset
    69
    [author:]
6d36f3ac42a2 documentation
Claus Gittinger <cg@exept.de>
parents: 249
diff changeset
    70
        Claus Gittinger
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
    71
"
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
    72
!
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
    73
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
    74
examples
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
    75
"
223
a204fe6b665c commentary & image fixes
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
    76
    For text printing, use:
270
efae030b0514 examples
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
    77
                                                                        [exBegin]
223
a204fe6b665c commentary & image fixes
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
    78
        |s|
a204fe6b665c commentary & image fixes
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
    79
248
8154a33717fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 246
diff changeset
    80
        s := Printer new.
223
a204fe6b665c commentary & image fixes
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
    81
        s nextPutAll:'hello'; cr.
a204fe6b665c commentary & image fixes
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
    82
        s bold.
a204fe6b665c commentary & image fixes
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
    83
        s nextPutAll:'this is bold'; cr.
a204fe6b665c commentary & image fixes
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
    84
        s normal.
a204fe6b665c commentary & image fixes
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
    85
        s italic.
a204fe6b665c commentary & image fixes
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
    86
        s nextPutAll:'this is italic'; cr.
349
e2806ca1c634 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 348
diff changeset
    87
        s boldItalic.
e2806ca1c634 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 348
diff changeset
    88
        s nextPutAll:'this is boldItalic'; cr.
223
a204fe6b665c commentary & image fixes
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
    89
        s normal.
a204fe6b665c commentary & image fixes
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
    90
        s nextPutAll:'normal again'; cr.
a204fe6b665c commentary & image fixes
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
    91
        s helvetica.
248
8154a33717fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 246
diff changeset
    92
        s nextPutAll:'helvetica'; cr.
223
a204fe6b665c commentary & image fixes
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
    93
        s times.
248
8154a33717fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 246
diff changeset
    94
        s nextPutAll:'times'; cr.
223
a204fe6b665c commentary & image fixes
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
    95
        s courier.
248
8154a33717fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 246
diff changeset
    96
        s nextPutAll:'courier'; cr.
223
a204fe6b665c commentary & image fixes
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
    97
        s close
270
efae030b0514 examples
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
    98
                                                                        [exEnd]
349
e2806ca1c634 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 348
diff changeset
    99
    or, if you already have emphasized text at hand:
e2806ca1c634 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 348
diff changeset
   100
                                                                        [exBegin]
e2806ca1c634 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 348
diff changeset
   101
        |s|
e2806ca1c634 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 348
diff changeset
   102
e2806ca1c634 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 348
diff changeset
   103
        s := Printer new.
e2806ca1c634 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 348
diff changeset
   104
        s nextPutAll:'hello'; cr.
e2806ca1c634 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 348
diff changeset
   105
        s nextPutAll:'this is '; 
e2806ca1c634 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 348
diff changeset
   106
          nextPutAll:(Text string:'bold' emphasis:#bold); 
e2806ca1c634 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 348
diff changeset
   107
          cr;
e2806ca1c634 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 348
diff changeset
   108
          nextPutAll:'this is '; 
e2806ca1c634 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 348
diff changeset
   109
          nextPutAll:(Text string:'italic' emphasis:#italic); 
e2806ca1c634 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 348
diff changeset
   110
          cr;
e2806ca1c634 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 348
diff changeset
   111
          nextPutAll:'this is ';
e2806ca1c634 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 348
diff changeset
   112
          nextPutAll:(Text string:'boldItalic' emphasis:#(bold italic)); 
e2806ca1c634 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 348
diff changeset
   113
          cr;
e2806ca1c634 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 348
diff changeset
   114
          nextPutAll:'normal again'; 
e2806ca1c634 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 348
diff changeset
   115
          cr;
e2806ca1c634 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 348
diff changeset
   116
          helvetica;
e2806ca1c634 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 348
diff changeset
   117
          nextPutAll:'helvetica';
e2806ca1c634 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 348
diff changeset
   118
          cr;
e2806ca1c634 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 348
diff changeset
   119
          times;
e2806ca1c634 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 348
diff changeset
   120
          nextPutAll:'times'; 
e2806ca1c634 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 348
diff changeset
   121
          cr;
e2806ca1c634 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 348
diff changeset
   122
          courier;
e2806ca1c634 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 348
diff changeset
   123
          nextPutAll:'courier';
e2806ca1c634 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 348
diff changeset
   124
          cr.
e2806ca1c634 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 348
diff changeset
   125
        s close
e2806ca1c634 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 348
diff changeset
   126
                                                                        [exEnd]
179
38773360f4b7 more on printing (printerType-query)
Claus Gittinger <cg@exept.de>
parents: 170
diff changeset
   127
361
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   128
    placing a page-hook, to add a page number:
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   129
    (page hooks require that you understand some postscript ...
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   130
     ... and have a look at how this class generates its postscript code)
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   131
                                                                        [exBegin]
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   132
        |s hook pageNr|
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   133
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   134
        s := Printer new.
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   135
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   136
        pageNr := 0.
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   137
        hook := [ 
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   138
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   139
                    pageNr := pageNr + 1.
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   140
                    s placeString:('page ' , pageNr printString) at:(5500 @ 400).
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   141
                ].
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   142
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   143
        s pageEndAction:hook.
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   144
        (1 to:200) do:[:lineNr |
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   145
            s nextPutAll:'line ' , lineNr printString.
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   146
            s cr.
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   147
        ].
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   148
        s close.
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   149
                                                                        [exEnd]
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   150
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   151
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   152
    placing a page-hook, to add a custom frame, logo or company letter-head:
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   153
    (page hooks require that you understand some postscript ...
375
ab43222a70ce added access methods for margins
Claus Gittinger <cg@exept.de>
parents: 373
diff changeset
   154
     ... and have a look at how this class generates its postscript code.
ab43222a70ce added access methods for margins
Claus Gittinger <cg@exept.de>
parents: 373
diff changeset
   155
     ... and notice that the code below is a q&d demo, working with letter-sized
ab43222a70ce added access methods for margins
Claus Gittinger <cg@exept.de>
parents: 373
diff changeset
   156
     pages only; a real program should ask the printerStream about the actual 
ab43222a70ce added access methods for margins
Claus Gittinger <cg@exept.de>
parents: 373
diff changeset
   157
     pageHeight/pageWidth.)
361
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   158
                                                                        [exBegin]
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   159
        |s hook pageNr|
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   160
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   161
        s := Printer new.
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   162
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   163
        pageNr := 0.
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   164
        hook := [ 
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   165
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   166
                    pageNr := pageNr + 1.
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   167
                    s placeString:('page ' , pageNr printString) at:(5500 @ 400).
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   168
                    s placeString:('Document revision:') at:(900 @ 1200).
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   169
                    s placeString:('Revieved by:')       at:(900 @ 900).
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   170
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   171
                    s setNative:true.
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   172
                    s nextPutAll:'0 setlinewidth'; cr.
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   173
                    s nextPutAll:'800 800 moveto'; cr.
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   174
                    s nextPutAll:'11000 800 lineto'; cr.
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   175
                    s nextPutAll:'11000 15500 lineto'; cr.
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   176
                    s nextPutAll:'800 15500 lineto'; cr.
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   177
                    s nextPutAll:'800 800 lineto'; cr.
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   178
                    s nextPutAll:'stroke'; cr.
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   179
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   180
                    s nextPutAll:'800 1100 moveto'; cr.
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   181
                    s nextPutAll:'11000 1100 lineto'; cr.
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   182
                    s nextPutAll:'stroke'; cr.
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   183
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   184
                    s nextPutAll:'800 1400 moveto'; cr.
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   185
                    s nextPutAll:'11000 1400 lineto'; cr.
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   186
                    s nextPutAll:'stroke'; cr.
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   187
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   188
                    s setNative:false.
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   189
                ].
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   190
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   191
        s pageEndAction:hook.
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   192
        (1 to:200) do:[:lineNr |
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   193
            s nextPutAll:'line ' , lineNr printString.
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   194
            s cr.
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   195
        ].
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   196
        s close.
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   197
                                                                        [exEnd]
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   198
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   199
223
a204fe6b665c commentary & image fixes
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   200
    If you already have a postscript string at hand, this can be sent to
a204fe6b665c commentary & image fixes
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   201
    the printer in native mode:
270
efae030b0514 examples
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   202
                                                                        [exBegin]
223
a204fe6b665c commentary & image fixes
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   203
        |s|
a204fe6b665c commentary & image fixes
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   204
248
8154a33717fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 246
diff changeset
   205
        s := Printer newNative.
223
a204fe6b665c commentary & image fixes
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   206
        s nextPutAll:<your postscript string>.
270
efae030b0514 examples
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   207
                                                                        [exEnd]
223
a204fe6b665c commentary & image fixes
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   208
        s close
a204fe6b665c commentary & image fixes
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   209
179
38773360f4b7 more on printing (printerType-query)
Claus Gittinger <cg@exept.de>
parents: 170
diff changeset
   210
    To output graphics, you need the PSGraphicsContext (and friend-) classes.
38773360f4b7 more on printing (printerType-query)
Claus Gittinger <cg@exept.de>
parents: 170
diff changeset
   211
    These provide protocol similar to the one provided by display graphicContexts.
223
a204fe6b665c commentary & image fixes
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   212
    Notice, that these postscript classes are derived from public domain code;
a204fe6b665c commentary & image fixes
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   213
    there is no warranty.
a204fe6b665c commentary & image fixes
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   214
a204fe6b665c commentary & image fixes
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   215
    Usage:
270
efae030b0514 examples
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   216
                                                                        [exBegin]
223
a204fe6b665c commentary & image fixes
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   217
        |drawable s|
a204fe6b665c commentary & image fixes
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   218
248
8154a33717fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 246
diff changeset
   219
        s := Printer newNative.
223
a204fe6b665c commentary & image fixes
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   220
        drawable := PSGraphicsContext on:s.
a204fe6b665c commentary & image fixes
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   221
a204fe6b665c commentary & image fixes
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   222
        drawable displayLineFrom:(0@0) to:(100@100).
348
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   223
        drawable displayLineFrom:(100@0) to:(0@100).
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   224
        drawable displayCircle:(150@150) radius:50.
223
a204fe6b665c commentary & image fixes
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   225
        (Image fromFile:'bitmaps/SBrowser.xbm') displayOn:drawable at:(50@30).
a204fe6b665c commentary & image fixes
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   226
a204fe6b665c commentary & image fixes
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   227
        drawable close.
270
efae030b0514 examples
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   228
                                                                        [exEnd]
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   229
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   230
      the same in a view:
270
efae030b0514 examples
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   231
                                                                        [exBegin]
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   232
        |drawable|
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   233
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   234
        drawable := (View extent:200@200) openAndWait.
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   235
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   236
        drawable displayLineFrom:(0@0) to:(100@100).
348
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   237
        drawable displayLineFrom:(100@0) to:(0@100).
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   238
        drawable displayCircle:(150@150) radius:50.
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   239
        (Image fromFile:'bitmaps/SBrowser.xbm') displayOn:drawable at:(50@30).
270
efae030b0514 examples
Claus Gittinger <cg@exept.de>
parents: 259
diff changeset
   240
                                                                        [exEnd]
6
claus
parents: 4
diff changeset
   241
"
claus
parents: 4
diff changeset
   242
! !
0
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   243
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   244
!PostscriptPrinterStream class methodsFor:'initialization'!
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   245
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   246
initCharacterSize
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   247
    "setup the character parameters"
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   248
361
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   249
    FontHeight := 200.   "/ used to scale fonts - corresponds to a 10 point font size
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   250
    FontWidth := 120.    "/ used to compute width of tabs
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   251
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   252
    "Created: 23.4.1996 / 19:53:34 / cg"
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   253
    "Modified: 23.4.1996 / 20:05:17 / cg"
361
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   254
    "Modified: 30.5.1996 / 17:24:05 / ca"
0
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   255
!
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   256
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   257
initFonts
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   258
    "setup the font names.
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   259
     initProlog uses those parameters."
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   260
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   261
    Italic := 0.     "/ offset from base-font# to italic version
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   262
    Bold := 1.       "/ offset from base-font# to bold version
349
e2806ca1c634 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 348
diff changeset
   263
    BoldItalic := 2. "/ offset from base-font# to boldItalic version
e2806ca1c634 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 348
diff changeset
   264
    Normal := 3.     "/ offset from base-font# to normal version
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   265
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   266
    Helvetica := 0.  "/ # of helvetica base font
349
e2806ca1c634 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 348
diff changeset
   267
    Times := 4.      "/ # of times base font
e2806ca1c634 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 348
diff changeset
   268
    Courier := 8.    "/ # of courier base font
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   269
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   270
    FontNames := #( 
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   271
                    '/Helvetica-Oblique'
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   272
                    '/Helvetica-Bold'
349
e2806ca1c634 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 348
diff changeset
   273
                    '/Helvetica-BoldOblique'
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   274
                    '/Helvetica'
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   275
                    '/Times-Italic'
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   276
                    '/Times-Bold'
349
e2806ca1c634 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 348
diff changeset
   277
                    '/Times-BoldItalic'
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   278
                    '/Times'
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   279
                    '/Courier-Oblique'
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   280
                    '/Courier-Bold'
349
e2806ca1c634 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 348
diff changeset
   281
                    '/Courier-BoldOblique'
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   282
                    '/Courier' 
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   283
                  )
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   284
349
e2806ca1c634 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 348
diff changeset
   285
    "Modified: 18.5.1996 / 09:37:48 / cg"
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   286
!
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   287
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   288
initPage
361
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   289
    "setup the page parameters.
370
705453f00711 keep per-printer defaults
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   290
     All coordinates are scaled by 20 w.r.t the PS coordinates (i.e. in twips)."
705453f00711 keep per-printer defaults
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   291
705453f00711 keep per-printer defaults
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   292
    PageFormat isNil ifTrue:[
705453f00711 keep per-printer defaults
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   293
        PageFormat := #letter
705453f00711 keep per-printer defaults
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   294
    ].
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   295
378
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   296
    TopInset isNil ifTrue:[
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   297
        TopInset := 0.652778.  "/ inches
370
705453f00711 keep per-printer defaults
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   298
    ].
378
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   299
    BottomInset isNil ifTrue:[
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   300
        BottomInset := 1.18056 "/ inches
370
705453f00711 keep per-printer defaults
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   301
    ].
378
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   302
    LeftInset isNil ifTrue:[
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   303
        LeftInset := 0.625.     "/ inches
370
705453f00711 keep per-printer defaults
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   304
    ].
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   305
361
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   306
    "/     +-----------------------------------------------+  PageHeight
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   307
    "/     |                                               |
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   308
    "/     | LeftX +---------------------------------------|  TopY
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   309
    "/     |       |1st printed line                       |
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   310
    "/     |       |                                       |
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   311
    "/     |       |                                       |
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   312
    "/     |       |                                       |
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   313
    "/     |       |                                       |
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   314
    "/     |       |last line (linesPerPage)               |
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   315
    "/     |       +---------------------------------------|
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   316
    "/     |                                               |
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   317
    "/     (0/0)-------------------------------------------+  0
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   318
378
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   319
    LeftX := (UnitConverter convert:LeftInset from:#inch to:#twip) rounded.
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   320
370
705453f00711 keep per-printer defaults
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   321
    PhysicalPageHeight := (UnitConverter convert:1 from:(PageFormat , 'H') to:#twip) rounded.
705453f00711 keep per-printer defaults
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   322
    Landscape ifTrue:[
705453f00711 keep per-printer defaults
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   323
        PageHeight := (UnitConverter convert:1 from:(PageFormat , 'lH') to:#twip) rounded.
705453f00711 keep per-printer defaults
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   324
    ] ifFalse:[
705453f00711 keep per-printer defaults
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   325
        PageHeight := (UnitConverter convert:1 from:(PageFormat , 'H') to:#twip) rounded.
705453f00711 keep per-printer defaults
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   326
    ].
705453f00711 keep per-printer defaults
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   327
378
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   328
    TopY := PageHeight - (UnitConverter convert:TopInset from:#inch to:#twip) rounded.
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   329
    LinesPerPage := TopY - (UnitConverter convert:BottomInset from:#inch to:#twip) rounded // 200.
370
705453f00711 keep per-printer defaults
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   330
361
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   331
    "Modified: 30.5.1996 / 17:24:55 / ca"
378
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   332
    "Modified: 3.6.1996 / 10:45:34 / cg"
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   333
!
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   334
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   335
initPageProlog
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   336
    "define the page prolog"
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   337
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   338
    PageProlog :=
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   339
'StartPage
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   340
'.
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   341
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   342
    "Created: 23.4.1996 / 19:56:16 / cg"
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   343
!
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   344
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   345
initPageTrailer
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   346
    "define the page epilog"
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   347
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   348
    PageTrailer :=
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   349
'EndPage
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   350
'.
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   351
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   352
    "Modified: 23.4.1996 / 19:55:50 / cg"
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   353
    "Created: 23.4.1996 / 19:56:30 / cg"
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   354
!
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   355
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   356
initProlog
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   357
    "define the documents prolog"
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   358
0
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   359
    |tmpString t fontNr|
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   360
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   361
    tmpString :=
0
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   362
'%!!PS-Adobe-1.0
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   363
%%Creator: Smalltalk/X
0
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   364
%%DocumentFonts: Courier-Oblique Courier-Bold Courier Times-Italic Times-Bold Times
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   365
save/SmalltalkJob exch def
361
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   366
/OriginalState gstate def
0
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   367
/StartSmalltalkDoc{$smalltalk begin}def
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   368
/$smalltalk 50 dict def $smalltalk begin
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   369
/EndSmalltalkDoc{end}def
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   370
/S/show load def
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   371
/X{exch 0 rmoveto S}def
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   372
/Y{exch 0 exch rmoveto S}def
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   373
/B{3 1 roll moveto S}def
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   374
/F{$fd exch get setfont}def
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   375
/StartPage{/svpg save def .05 dup scale}def
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   376
/EndPage{svpg restore showpage}def
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   377
/DoPreFeed{/statusdict where{pop
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   378
 statusdict/prefeed known{statusdict exch/prefeed exch put 0}if}if pop}def
373
6834d6a61ea9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 372
diff changeset
   379
/Landscape{90 rotate 0 -' , PageHeight printString "15840", ' translate}def
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   380
/ISOrecode {findfont dup length dict begin
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   381
 {1 index /FID ne {def} {pop pop} ifelse} forall
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   382
 /Encoding ISOLatin1Encoding def
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   383
 currentdict end definefont pop} def
0
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   384
/SetUpFonts
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   385
 {dup/$fd exch array def{findfont exch scalefont $fd 3 1 roll put}repeat}def
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   386
/InitGaudy{/TwoColumn exch def /BarLength exch def
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   387
/ftD /ISO-Times-Bold findfont 12 UP scalefont def
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   388
/ftF /ISO-Times-Roman findfont 14 UP scalefont def
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   389
/ftP /ISO-Helvetica-Bold findfont 30 UP scalefont def}def
0
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   390
/U{1440 mul}def
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   391
/UP{U 72 div}def
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   392
/LB{/pts exch UP def /charcolor exch def /boxcolor exch def /font exch def
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   393
 /label exch def /dy exch def /dx exch def /lly exch def /llx exch def
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   394
 gsave boxcolor setgray
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   395
 llx lly moveto dx 0 rlineto 0 dy rlineto dx neg 0 rlineto closepath fill
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   396
 /lines label length def
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   397
 /yp lly dy add dy lines pts mul sub 2 div sub pts .85 mul sub def
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   398
 font setfont charcolor setgray
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   399
 label {dup stringwidth pop 2 div llx dx 2 div add exch sub yp moveto show
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   400
   /yp yp pts sub def}forall grestore}def
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   401
/Gaudy{/Page exch def /Date exch def /File exch def /Comment exch def
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   402
 .25 U 10.2 U BarLength .1 sub U .25 U [File] ftF .97 0 14 LB
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   403
 .25 U 10.45 U BarLength .1 sub U .25 U [Comment] ftF 1 0 14 LB
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   404
 .25 U 10.2 U 1 U .5 U Date ftD .7 0 12 LB
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   405
 BarLength .75 sub U 10.2 U 1 U .5 U [Page] ftP .7 1 30 LB
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   406
 TwoColumn{BarLength 2 div .19 add U 10.2 U moveto 0 -10 U rlineto stroke}if
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   407
}def
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   408
end
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   409
StartSmalltalkDoc 
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   410
% end of fixed prolog
0
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   411
'.
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   412
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   413
    t := ''.
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   414
    FontNames do:[:aName |
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   415
        t := t , '/ISO-' , aName , ' ' , aName , ' ISOrecode
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   416
'.
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   417
    ].
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   418
    t := t , '
0
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   419
'.
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   420
    tmpString := tmpString , t.
0
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   421
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   422
    t := ''.
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   423
    fontNr := 0.
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   424
    FontNames do:[:aName |
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   425
        t := t , (fontNr printString) , ' ' 
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   426
               , (FontHeight printString) , ' '
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   427
               , aName , (Character nl) asString.
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   428
        fontNr := fontNr + 1
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   429
    ].
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   430
    tmpString := tmpString , t.
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   431
    tmpString := tmpString , fontNr printString , ' SetUpFonts
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   432
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   433
% end of prolog
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   434
'.
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   435
    Prolog := tmpString.
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   436
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   437
    "
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   438
     PostscriptPrinterStream initProlog
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   439
    "
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   440
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   441
    "Created: 23.4.1996 / 19:40:44 / cg"
373
6834d6a61ea9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 372
diff changeset
   442
    "Modified: 1.6.1996 / 00:46:20 / cg"
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   443
!
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   444
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   445
initTrailer
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   446
    "define the documents epilog"
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   447
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   448
        Trailer :=
0
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   449
'EndSmalltalkDoc
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   450
SmalltalkJob restore
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   451
'
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   452
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   453
    "Created: 23.4.1996 / 19:55:24 / cg"
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   454
    "Modified: 23.4.1996 / 19:55:38 / cg"
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   455
!
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   456
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   457
initialize
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   458
    Normal isNil ifTrue:[
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   459
        self initFonts.
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   460
        self initPage.
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   461
        self initCharacterSize.
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   462
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   463
        self initProlog.
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   464
        self initTrailer.
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   465
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   466
        self initPageProlog.
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   467
        self initPageTrailer
170
7194ef17f5b8 only init once
Claus Gittinger <cg@exept.de>
parents: 126
diff changeset
   468
    ]
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   469
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   470
    "
349
e2806ca1c634 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 348
diff changeset
   471
     Normal := nil.
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   472
     self initialize
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   473
    "
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   474
349
e2806ca1c634 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 348
diff changeset
   475
    "Modified: 18.5.1996 / 09:46:15 / cg"
370
705453f00711 keep per-printer defaults
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   476
!
705453f00711 keep per-printer defaults
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   477
705453f00711 keep per-printer defaults
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   478
reInitPage
705453f00711 keep per-printer defaults
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   479
    self initPage.
705453f00711 keep per-printer defaults
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   480
    self initProlog.
705453f00711 keep per-printer defaults
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   481
705453f00711 keep per-printer defaults
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   482
    "Created: 31.5.1996 / 23:35:18 / cg"
705453f00711 keep per-printer defaults
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   483
! !
705453f00711 keep per-printer defaults
Claus Gittinger <cg@exept.de>
parents: 368
diff changeset
   484
375
ab43222a70ce added access methods for margins
Claus Gittinger <cg@exept.de>
parents: 373
diff changeset
   485
!PostscriptPrinterStream class methodsFor:'accessing - defaults'!
ab43222a70ce added access methods for margins
Claus Gittinger <cg@exept.de>
parents: 373
diff changeset
   486
ab43222a70ce added access methods for margins
Claus Gittinger <cg@exept.de>
parents: 373
diff changeset
   487
bottomInset
ab43222a70ce added access methods for margins
Claus Gittinger <cg@exept.de>
parents: 373
diff changeset
   488
    "return the bottom margin (in inches)"
ab43222a70ce added access methods for margins
Claus Gittinger <cg@exept.de>
parents: 373
diff changeset
   489
378
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   490
    ^ BottomInset
375
ab43222a70ce added access methods for margins
Claus Gittinger <cg@exept.de>
parents: 373
diff changeset
   491
ab43222a70ce added access methods for margins
Claus Gittinger <cg@exept.de>
parents: 373
diff changeset
   492
    "Created: 1.6.1996 / 13:07:43 / cg"
378
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   493
    "Modified: 3.6.1996 / 10:44:44 / cg"
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   494
!
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   495
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   496
bottomInset:inches
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   497
    "set the bottom margin (in inches)"
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   498
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   499
    BottomInset := inches.
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   500
    self reInitPage.
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   501
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   502
    "Created: 3.6.1996 / 10:46:25 / cg"
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   503
    "Modified: 3.6.1996 / 10:47:16 / cg"
375
ab43222a70ce added access methods for margins
Claus Gittinger <cg@exept.de>
parents: 373
diff changeset
   504
!
ab43222a70ce added access methods for margins
Claus Gittinger <cg@exept.de>
parents: 373
diff changeset
   505
ab43222a70ce added access methods for margins
Claus Gittinger <cg@exept.de>
parents: 373
diff changeset
   506
leftInset
ab43222a70ce added access methods for margins
Claus Gittinger <cg@exept.de>
parents: 373
diff changeset
   507
    "return the left margin (in inches)"
ab43222a70ce added access methods for margins
Claus Gittinger <cg@exept.de>
parents: 373
diff changeset
   508
378
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   509
    ^ LeftInset
375
ab43222a70ce added access methods for margins
Claus Gittinger <cg@exept.de>
parents: 373
diff changeset
   510
ab43222a70ce added access methods for margins
Claus Gittinger <cg@exept.de>
parents: 373
diff changeset
   511
    "Created: 1.6.1996 / 13:07:12 / cg"
378
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   512
    "Modified: 3.6.1996 / 10:45:11 / cg"
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   513
!
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   514
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   515
leftInset:inches
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   516
    "set the left margin (in inches)"
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   517
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   518
    LeftInset := inches.
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   519
    self reInitPage.
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   520
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   521
    "Created: 3.6.1996 / 10:46:33 / cg"
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   522
    "Modified: 3.6.1996 / 10:47:21 / cg"
375
ab43222a70ce added access methods for margins
Claus Gittinger <cg@exept.de>
parents: 373
diff changeset
   523
!
ab43222a70ce added access methods for margins
Claus Gittinger <cg@exept.de>
parents: 373
diff changeset
   524
ab43222a70ce added access methods for margins
Claus Gittinger <cg@exept.de>
parents: 373
diff changeset
   525
topInset
ab43222a70ce added access methods for margins
Claus Gittinger <cg@exept.de>
parents: 373
diff changeset
   526
    "return the top margin (in inches)"
ab43222a70ce added access methods for margins
Claus Gittinger <cg@exept.de>
parents: 373
diff changeset
   527
378
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   528
    ^ TopInset
375
ab43222a70ce added access methods for margins
Claus Gittinger <cg@exept.de>
parents: 373
diff changeset
   529
ab43222a70ce added access methods for margins
Claus Gittinger <cg@exept.de>
parents: 373
diff changeset
   530
    "Created: 1.6.1996 / 13:07:20 / cg"
378
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   531
    "Modified: 3.6.1996 / 10:45:17 / cg"
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   532
!
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   533
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   534
topInset:inches
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   535
    "set the top margin (in inches)"
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   536
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   537
    TopInset := inches.
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   538
    self reInitPage.
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   539
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   540
    "Created: 3.6.1996 / 10:46:41 / cg"
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   541
    "Modified: 3.6.1996 / 10:47:26 / cg"
375
ab43222a70ce added access methods for margins
Claus Gittinger <cg@exept.de>
parents: 373
diff changeset
   542
! !
ab43222a70ce added access methods for margins
Claus Gittinger <cg@exept.de>
parents: 373
diff changeset
   543
186
bc1b056b097c added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents: 179
diff changeset
   544
!PostscriptPrinterStream class methodsFor:'queries'!
bc1b056b097c added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents: 179
diff changeset
   545
bc1b056b097c added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents: 179
diff changeset
   546
printerTypeName
bc1b056b097c added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents: 179
diff changeset
   547
    "return a descriptive name"
bc1b056b097c added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents: 179
diff changeset
   548
bc1b056b097c added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents: 179
diff changeset
   549
    ^ 'postscript printer'
bc1b056b097c added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents: 179
diff changeset
   550
!
bc1b056b097c added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents: 179
diff changeset
   551
378
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   552
supportsMargins
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   553
    "return true if this printer supports margins"
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   554
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   555
    ^ true
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   556
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   557
    "Created: 3.6.1996 / 10:48:04 / cg"
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   558
!
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   559
368
423cf3f4e522 added query if printer supports pages at all (only PS does)
Claus Gittinger <cg@exept.de>
parents: 361
diff changeset
   560
supportsPageSizes
423cf3f4e522 added query if printer supports pages at all (only PS does)
Claus Gittinger <cg@exept.de>
parents: 361
diff changeset
   561
    "return true if this printer supports different page sizes"
423cf3f4e522 added query if printer supports pages at all (only PS does)
Claus Gittinger <cg@exept.de>
parents: 361
diff changeset
   562
423cf3f4e522 added query if printer supports pages at all (only PS does)
Claus Gittinger <cg@exept.de>
parents: 361
diff changeset
   563
    ^ true
423cf3f4e522 added query if printer supports pages at all (only PS does)
Claus Gittinger <cg@exept.de>
parents: 361
diff changeset
   564
423cf3f4e522 added query if printer supports pages at all (only PS does)
Claus Gittinger <cg@exept.de>
parents: 361
diff changeset
   565
    "Created: 31.5.1996 / 22:35:39 / cg"
423cf3f4e522 added query if printer supports pages at all (only PS does)
Claus Gittinger <cg@exept.de>
parents: 361
diff changeset
   566
!
423cf3f4e522 added query if printer supports pages at all (only PS does)
Claus Gittinger <cg@exept.de>
parents: 361
diff changeset
   567
186
bc1b056b097c added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents: 179
diff changeset
   568
supportsPostscript
bc1b056b097c added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents: 179
diff changeset
   569
    "return true if this is a postscript printer"
bc1b056b097c added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents: 179
diff changeset
   570
bc1b056b097c added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents: 179
diff changeset
   571
    ^ true
bc1b056b097c added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents: 179
diff changeset
   572
bc1b056b097c added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents: 179
diff changeset
   573
    "Created: 10.2.1996 / 16:23:23 / cg"
bc1b056b097c added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents: 179
diff changeset
   574
! !
bc1b056b097c added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents: 179
diff changeset
   575
222
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   576
!PostscriptPrinterStream methodsFor:'access writing'!
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   577
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   578
cr
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   579
    "send line termination"
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   580
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   581
    self flushLine.
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   582
    native == true ifTrue:[^ super cr].
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   583
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   584
    xPos := LeftX.
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   585
    colNr := 0.
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   586
    yPos := yPos - FontHeight.
375
ab43222a70ce added access methods for margins
Claus Gittinger <cg@exept.de>
parents: 373
diff changeset
   587
222
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   588
    lineNr := lineNr + 1.
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   589
    lineNr > LinesPerPage ifTrue:[
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   590
        self nextPage
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   591
    ]
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   592
375
ab43222a70ce added access methods for margins
Claus Gittinger <cg@exept.de>
parents: 373
diff changeset
   593
    "Modified: 1.6.1996 / 13:09:30 / cg"
222
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   594
!
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   595
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   596
nextPut:aCharacter
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   597
    |code|
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   598
222
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   599
    (aCharacter == Character cr) ifTrue:[
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   600
        ^ self cr
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   601
    ].
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   602
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   603
    native == true ifTrue:[
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   604
        self flushLine.
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   605
        ^ super nextPut:aCharacter
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   606
    ].
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   607
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   608
    (aCharacter == $( ) ifTrue:[
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   609
        lineBuffer := lineBuffer , '\(' .
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   610
        ^ self
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   611
    ].
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   612
    (aCharacter == $) ) ifTrue:[
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   613
        lineBuffer := lineBuffer , '\)' .
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   614
        ^ self
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   615
    ].
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   616
    (aCharacter == $\ ) ifTrue:[
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   617
        lineBuffer := lineBuffer , '\\' .
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   618
        ^ self
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   619
    ].
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   620
222
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   621
    (aCharacter == Character tab ) ifTrue:[
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   622
        self flushLine.
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   623
        colNr := ((colNr + 8) // 8) * 8. 
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   624
        xPos := LeftX + (colNr * FontWidth).
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   625
        ^ self
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   626
    ].
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   627
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   628
    (code := aCharacter asciiValue) > 16r7F ifTrue:[
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   629
        lineBuffer := lineBuffer , '\' , (code printStringRadix:8)
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   630
    ] ifFalse:[
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   631
        lineBuffer := lineBuffer copyWith:aCharacter
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   632
    ].
222
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   633
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   634
    "Modified: 23.4.1996 / 20:05:59 / cg"
222
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   635
! !
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   636
361
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   637
!PostscriptPrinterStream methodsFor:'accessing'!
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   638
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   639
pageEndAction:something
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   640
    "set pageEndAction - if non-nil, that will be called before
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   641
     and EndPage is emmitted. 
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   642
     An example use is a private block,
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   643
     which draws a company frame around the page ..."
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   644
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   645
    pageEndAction := something.
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   646
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   647
    "Modified: 30.5.1996 / 16:45:09 / ca"
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   648
!
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   649
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   650
pageStartAction:something
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   651
    "set pageStartAction - if nonNil, that is evaluated prior to every page."
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   652
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   653
    pageStartAction := something.
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   654
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   655
    "Modified: 30.5.1996 / 16:44:20 / ca"
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   656
! !
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   657
348
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   658
!PostscriptPrinterStream methodsFor:'emphasis change'!
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   659
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   660
bold
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   661
    "further printing is in bold"
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   662
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   663
    self flushLine.
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   664
    fStyle := Bold.
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   665
    self setFont
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   666
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   667
    "Modified: 10.4.1996 / 13:34:37 / cg"
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   668
!
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   669
349
e2806ca1c634 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 348
diff changeset
   670
boldItalic
e2806ca1c634 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 348
diff changeset
   671
    "further printing is in boldItalic"
e2806ca1c634 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 348
diff changeset
   672
e2806ca1c634 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 348
diff changeset
   673
    self flushLine.
e2806ca1c634 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 348
diff changeset
   674
    fStyle := BoldItalic.
e2806ca1c634 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 348
diff changeset
   675
    self setFont
e2806ca1c634 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 348
diff changeset
   676
e2806ca1c634 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 348
diff changeset
   677
    "Created: 18.5.1996 / 09:36:36 / cg"
e2806ca1c634 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 348
diff changeset
   678
    "Modified: 18.5.1996 / 09:43:10 / cg"
e2806ca1c634 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 348
diff changeset
   679
!
e2806ca1c634 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 348
diff changeset
   680
348
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   681
italic
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   682
    "further printing is in italic"
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   683
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   684
    self flushLine.
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   685
    fStyle := Italic.
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   686
    self setFont
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   687
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   688
    "Modified: 10.4.1996 / 13:35:16 / cg"
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   689
!
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   690
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   691
normal
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   692
    "further printing is in normal style (i.e. non-bold/non-italic)"
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   693
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   694
    self flushLine.
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   695
    fStyle := Normal.
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   696
    self setFont
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   697
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   698
    "Modified: 10.4.1996 / 13:35:57 / cg"
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   699
! !
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   700
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   701
!PostscriptPrinterStream methodsFor:'font change'!
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   702
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   703
courier
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   704
    "further printing is in the courier font"
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   705
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   706
    self flushLine.
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   707
    fFamily := Courier.
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   708
    self setFont
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   709
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   710
    "Modified: 10.4.1996 / 13:34:49 / cg"
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   711
!
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   712
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   713
helvetica
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   714
    "further printing is in the helvetica font"
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   715
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   716
    self flushLine.
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   717
    fFamily := Helvetica.
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   718
    self setFont
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   719
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   720
    "Modified: 10.4.1996 / 13:34:58 / cg"
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   721
!
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   722
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   723
times
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   724
    "further printing is in the times font"
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   725
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   726
    self flushLine.
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   727
    fFamily := Times.
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   728
    self setFont
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   729
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   730
    "Modified: 10.4.1996 / 13:36:07 / cg"
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   731
! !
e4790af5d077 comments & category rename
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   732
126
fca9404da9d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   733
!PostscriptPrinterStream methodsFor:'open/close'!
fca9404da9d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   734
fca9404da9d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   735
endPrint
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   736
    "finish a document - finish page; then send documentTrailer.
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   737
     Send nothing if nativePrinting."
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   738
222
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   739
    native == true ifFalse:[
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   740
        self endPage.
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   741
        super nextPutAllUntranslated:Trailer.
222
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   742
    ].
126
fca9404da9d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   743
    super endPrint
222
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   744
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   745
    "Modified: 23.4.1996 / 20:03:26 / cg"
0
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   746
!
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   747
126
fca9404da9d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   748
startPrint
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   749
    "start a document - send documentProlog & start a page.
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   750
     Send nothing if nativePrinting."
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   751
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   752
    fFamily := Courier.
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   753
    fStyle := Normal.
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   754
222
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   755
    native == true ifFalse:[
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   756
        Prolog isNil ifTrue:[
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   757
            self class initialize
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   758
        ].
372
33c9e669f8dd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 371
diff changeset
   759
        super writingTo:(self class printCommand).
222
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   760
        super nextPutAllUntranslated:Prolog.
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   761
        self startPage
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   762
    ]
15d1c9a82bc6 suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents: 186
diff changeset
   763
373
6834d6a61ea9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 372
diff changeset
   764
    "Modified: 1.6.1996 / 00:43:50 / cg"
126
fca9404da9d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   765
! !
fca9404da9d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   766
fca9404da9d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   767
!PostscriptPrinterStream methodsFor:'private'!
fca9404da9d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   768
fca9404da9d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   769
endPage
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   770
    "end a page - flush buffered text & send pageTrailer"
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   771
0
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   772
    self flushLine.
361
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   773
    pageEndAction notNil ifTrue:[
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   774
        pageEndAction value
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   775
    ].
126
fca9404da9d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   776
    super nextPutAllUntranslated:PageTrailer
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   777
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   778
    "Modified: 23.4.1996 / 20:00:01 / cg"
0
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   779
!
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   780
126
fca9404da9d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   781
flushLine
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   782
    "flush buffered line text"
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   783
126
fca9404da9d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   784
    (lineBuffer size > 0) ifTrue:[
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   785
        super nextPutAllUntranslated:(xPos printString ).
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   786
        super nextPutAllUntranslated:' '.
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   787
        super nextPutAllUntranslated:(yPos printString).
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   788
        super nextPutAllUntranslated:'('.
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   789
        super nextPutAllUntranslated:lineBuffer.
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   790
        super nextPutAllUntranslated:')B'.
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   791
        super nextPutUntranslated:(Character cr).
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   792
        xPos := xPos + (FontWidth * lineBuffer size).
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   793
        colNr := colNr + lineBuffer size
126
fca9404da9d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   794
    ].
fca9404da9d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   795
    lineBuffer := ''
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   796
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   797
    "Modified: 23.4.1996 / 20:00:13 / cg"
126
fca9404da9d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   798
!
fca9404da9d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   799
fca9404da9d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   800
nextPage
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   801
    "new page - finish previous page & start enew.
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   802
     Should not be sent when nativePrinting."
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   803
126
fca9404da9d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   804
    self endPage.
fca9404da9d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   805
    self startPage
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   806
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   807
    "Modified: 23.4.1996 / 20:04:07 / cg"
0
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   808
!
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   809
361
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   810
placeString:aString at:pos
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   811
    "special entry: place a string at some particular position in my ps-coordinate
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   812
     system. Can be used with endPageActions to place a page-number."
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   813
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   814
    self flushLine.
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   815
    super nextPutAllUntranslated:(pos x printString ).
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   816
    super nextPutAllUntranslated:' '.
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   817
    super nextPutAllUntranslated:(pos y printString).
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   818
    super nextPutAllUntranslated:'('.
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   819
    super nextPutAllUntranslated:aString.
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   820
    super nextPutAllUntranslated:')B'.
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   821
    super nextPutUntranslated:(Character cr).
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   822
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   823
    "Created: 30.5.1996 / 17:06:36 / ca"
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   824
!
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   825
126
fca9404da9d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   826
setFont
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   827
    "change the font. 
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   828
     Uses current fFamily and fStyle (which give the fonts nr)"
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   829
126
fca9404da9d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   830
    |fontNumber|
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   831
126
fca9404da9d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   832
    fontNumber := fFamily + fStyle.
fca9404da9d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   833
    super nextPutAllUntranslated:fontNumber printString.
fca9404da9d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   834
    super nextPutAllUntranslated:' F'. 
fca9404da9d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   835
    super nextPutUntranslated:(Character cr)
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   836
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   837
    "Modified: 23.4.1996 / 20:01:28 / cg"
0
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   838
!
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   839
126
fca9404da9d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   840
startPage
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   841
    "start a page - send pageProlog, reset x/y position and line/col."
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   842
361
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   843
    pageStartAction notNil ifTrue:[
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   844
        pageStartAction value
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   845
    ].
126
fca9404da9d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   846
    super nextPutAllUntranslated:PageProlog.
373
6834d6a61ea9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 372
diff changeset
   847
    self class landscape ifTrue:[
6834d6a61ea9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 372
diff changeset
   848
        super nextPutAllUntranslated:'Landscape
6834d6a61ea9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 372
diff changeset
   849
'.
6834d6a61ea9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 372
diff changeset
   850
    ].
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   851
126
fca9404da9d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   852
    self setFont.
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   853
126
fca9404da9d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   854
    yPos := TopY.
fca9404da9d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   855
    xPos := LeftX.
fca9404da9d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   856
    lineBuffer := ''.
fca9404da9d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   857
    lineNr := 1.
fca9404da9d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   858
    colNr := 0
246
ba03a2af594c fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents: 223
diff changeset
   859
373
6834d6a61ea9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 372
diff changeset
   860
    "Modified: 1.6.1996 / 00:44:10 / cg"
0
1cf8d1747859 Initial revision
claus
parents:
diff changeset
   861
! !
126
fca9404da9d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   862
361
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   863
!PostscriptPrinterStream methodsFor:'queries'!
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   864
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   865
fontHeight
375
ab43222a70ce added access methods for margins
Claus Gittinger <cg@exept.de>
parents: 373
diff changeset
   866
    "the used fonts height in my postscript coordinate system 
ab43222a70ce added access methods for margins
Claus Gittinger <cg@exept.de>
parents: 373
diff changeset
   867
     (i.e. in twips, which is 1/20th of a point)"
361
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   868
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   869
    ^ FontHeight
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   870
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   871
    "Modified: 30.5.1996 / 16:47:37 / ca"
375
ab43222a70ce added access methods for margins
Claus Gittinger <cg@exept.de>
parents: 373
diff changeset
   872
    "Modified: 1.6.1996 / 13:14:51 / cg"
361
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   873
!
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   874
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   875
leftX
375
ab43222a70ce added access methods for margins
Claus Gittinger <cg@exept.de>
parents: 373
diff changeset
   876
    "the left x startPosition (i.e. leftMargin) in my postscript coordinate system.
ab43222a70ce added access methods for margins
Claus Gittinger <cg@exept.de>
parents: 373
diff changeset
   877
     (i.e. in twips, which is 1/20th of a point)"
361
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   878
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   879
    ^ LeftX
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   880
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   881
    "Modified: 30.5.1996 / 16:48:56 / ca"
375
ab43222a70ce added access methods for margins
Claus Gittinger <cg@exept.de>
parents: 373
diff changeset
   882
    "Modified: 1.6.1996 / 13:14:59 / cg"
361
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   883
!
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   884
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   885
linesPerPage
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   886
    "the number of lines per page"
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   887
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   888
    ^ LinesPerPage
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   889
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   890
    "Modified: 30.5.1996 / 16:48:20 / ca"
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   891
!
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   892
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   893
overAllPageSize
375
ab43222a70ce added access methods for margins
Claus Gittinger <cg@exept.de>
parents: 373
diff changeset
   894
    "the overAll pageSize in my postscript coordinate system.
ab43222a70ce added access methods for margins
Claus Gittinger <cg@exept.de>
parents: 373
diff changeset
   895
     (i.e. in twips, which is 1/20th of a point)"
361
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   896
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   897
    ^ PageHeight
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   898
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   899
    "Created: 30.5.1996 / 16:56:51 / ca"
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   900
    "Modified: 30.5.1996 / 16:58:01 / ca"
375
ab43222a70ce added access methods for margins
Claus Gittinger <cg@exept.de>
parents: 373
diff changeset
   901
    "Modified: 1.6.1996 / 13:15:06 / cg"
361
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   902
!
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   903
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   904
topMargin
375
ab43222a70ce added access methods for margins
Claus Gittinger <cg@exept.de>
parents: 373
diff changeset
   905
    "return the topMargin in my postscript coordinate system.
ab43222a70ce added access methods for margins
Claus Gittinger <cg@exept.de>
parents: 373
diff changeset
   906
     (i.e. in twips, which is 1/20th of a point)"
361
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   907
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   908
    ^ PageHeight - TopY
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   909
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   910
    "Modified: 30.5.1996 / 16:58:01 / ca"
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   911
    "Created: 30.5.1996 / 17:02:02 / ca"
375
ab43222a70ce added access methods for margins
Claus Gittinger <cg@exept.de>
parents: 373
diff changeset
   912
    "Modified: 1.6.1996 / 13:15:50 / cg"
361
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   913
!
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   914
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   915
topY
375
ab43222a70ce added access methods for margins
Claus Gittinger <cg@exept.de>
parents: 373
diff changeset
   916
    "the top y startPosition (i.e. page-size - topMargin) in my own coordinate system
ab43222a70ce added access methods for margins
Claus Gittinger <cg@exept.de>
parents: 373
diff changeset
   917
     (i.e. in twips, which is 1/20th of a point)"
361
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   918
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   919
    ^ TopY
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   920
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   921
    "Modified: 30.5.1996 / 16:48:48 / ca"
375
ab43222a70ce added access methods for margins
Claus Gittinger <cg@exept.de>
parents: 373
diff changeset
   922
    "Modified: 1.6.1996 / 13:15:23 / cg"
361
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   923
! !
4b3d82315b8a added hooks & query methods (see hook-example)
ca
parents: 349
diff changeset
   924
186
bc1b056b097c added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents: 179
diff changeset
   925
!PostscriptPrinterStream class methodsFor:'documentation'!
bc1b056b097c added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents: 179
diff changeset
   926
bc1b056b097c added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents: 179
diff changeset
   927
version
378
91abcf70e0c3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   928
    ^ '$Header: /cvs/stx/stx/libbasic2/PostscriptPrinterStream.st,v 1.34 1996-06-03 10:02:05 cg Exp $'
186
bc1b056b097c added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents: 179
diff changeset
   929
! !
126
fca9404da9d4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 112
diff changeset
   930
PostscriptPrinterStream initialize!