eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'PrinterContext':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: PrinterContext


Inheritance:

   Object
   |
   +--GraphicsContext
      |
      +--DeviceGraphicsContext
         |
         +--PrinterContext

Package:
stx:libview2
Category:
Interface-Printing
Version:
rev: 1.29 date: 2023/12/08 13:19:55
user: cg
file: PrinterContext.st directory: libview2
module: stx stc-classLibrary: libview2

Description:


I am the mediator between the smalltalk printing protocol
(which is the same as the graphics drawing protocol) and the
windows printer.
When you open a printer, you will typically talk to me, and I will
forward the graphics commands to my printer.

copyright

COPYRIGHT (c) 2006 by eXept Software AG All Rights Reserved This software is furnished under a license and may be used only in accordance with the terms of that license and with the inclusion of the above copyright notice. This software may not be provided or otherwise made available to, or used by, any other person. No title to or ownership of the software is hereby transferred.

Class protocol:

accessing
o  default
Answer the default Printer, or nil if none.

Usage example(s):

     self default

o  defaultMargins
Private - answer aPoint containing the default horizontal and vertical
margins for a page (units in inches).

o  defaultPrinterName
Answer the name of the default printer, or nil if none.

Usage example(s):

     PrinterContext defaultPrinterName

o  getPrinterInformation: printerNameString
Answer the printer information for the printer named printerNameString. If no name is specified,
answer the information for the default printer.

** This method must be redefined in concrete classes (subclassResponsibility) **

o  named: aName
Answer a new instance of Printer which represents
the printer named aName as specified in the host
Control Panel.

o  printerNames
Answer a collection of all known printer names.

instance creation
o  fromPrinterInfo: aPrinterInfo

** This method must be redefined in concrete classes (subclassResponsibility) **


Instance protocol:

abort handling
o  abortPrintJob
Abort the current print job.

o  aborted
Answer whether the user aborted from PrintAbortDialog.

accessing
o  container

o  getCharHeight
Private - answer the height of the font selected in the receiver's
device context.

** This method must be redefined in concrete classes (subclassResponsibility) **

o  horizontalPixelsPerMeter
Answer horizontal pixels per meter on the screen.

o  name
Answer the receiver's name from the current printerInfo.

o  name: aName
Set the receiver's printer name to aName.

o  numberOfColorBitsPerPixel

** This method must be redefined in concrete classes (subclassResponsibility) **

o  physicalOffsetX

** This method must be redefined in concrete classes (subclassResponsibility) **

o  physicalOffsetY

** This method must be redefined in concrete classes (subclassResponsibility) **

o  pixelsPerInchOfScreenHeight

** This method must be redefined in concrete classes (subclassResponsibility) **

o  pixelsPerInchOfScreenWidth

** This method must be redefined in concrete classes (subclassResponsibility) **

o  printerHeightArea

** This method must be redefined in concrete classes (subclassResponsibility) **

o  printerInfo

o  printerInfo: aPrinterInfo

o  printerInfoWithName: aName

o  printerPhysicalHeight

** This method must be redefined in concrete classes (subclassResponsibility) **

o  printerPhysicalWidth

** This method must be redefined in concrete classes (subclassResponsibility) **

o  printerUserFriendlyName
Answer the receiver's name from the current printerInfo.

o  printerWidthArea

** This method must be redefined in concrete classes (subclassResponsibility) **

o  setPrinterFont: aFont

o  setTextAlign: aNumber

o  setViewportOrg: aPoint

** This method must be redefined in concrete classes (subclassResponsibility) **

o  verticalPixelsPerMeter
Answer vertical pixels per meter on the screen.

initialization & release
o  buildPrinter
Private - create all the operating system resources needed.

o  createDC
Private - Create a device context for the receiver

** This method must be redefined in concrete classes (subclassResponsibility) **

o  initExtent
Private - init the width and height of GraphicsTool for the receiver.

o  releaseDC
Private - Closes the device context of the receiver

** This method must be redefined in concrete classes (subclassResponsibility) **

printing
o  print: aString font: aFont title: aTitle wordWrap: wordWrapBoolean marginsRect: aMarginsRect
Answer the receiver. Output the receiver string to
the printer using aFont. A Print abort dialog box will be opened
with aTitle. If collateBoolean is true, collate output, otherwise
do not. Print copiesInteger copies of the specified string. If
wordWrapBoolean is true, word wrap the lines, otherwise do not.
Left, top, right & bottom margins are specified in inches in
aMarginsRect.

o  print: aString pageHeader: aString2 font: aFont title: aTitle collate: collateBoolean copies: copiesInteger wordWrap: wordWrapBoolean marginsRect: aMarginsRect
Private - Answer the receiver. Output the receiver string to
the printer using aFont. A Print abort dialog box will be opened
with aTitle. If collateBoolean is true, collate output, otherwise
do not. Print copiesInteger copies of the specified string. If
wordWrapBoolean is true, word wrap the lines, otherwise do not.
Left, top, right & bottom margins are specified in inches in
aMarginsRect.
Mg: Erweitert um pageHeader

o  print: aString pageHeader: aString2 font: aFont title: aTitle wordWrap: wordWrapBoolean marginsRect: aMarginsRect
Private - Answer the receiver. Output the receiver string to
the printer using aFont. A Print abort dialog box will be opened
with aTitle. If collateBoolean is true, collate output, otherwise
do not. Print copiesInteger copies of the specified string. If
wordWrapBoolean is true, word wrap the lines, otherwise do not.
Left, top, right & bottom margins are specified in inches in
aMarginsRect.

printing process
o  endPage
Informs device that we are finished writing to a page.

** This method must be redefined in concrete classes (subclassResponsibility) **

o  endPrintJob
End the print job. Everything drawn between startPrintJob
and endPrintJob will become one entry in the print queue.
Close and clean the device context of the receiver

o  endPrintJobWithoutRelease
End the print job. Everything drawn between startPrintJob
and endPrintJob will become one entry in the print queue.
Won't close the DC

** This method must be redefined in concrete classes (subclassResponsibility) **

o  formFeed
Send a form feed to the printer.

o  startPage
Starts a page.

** This method must be redefined in concrete classes (subclassResponsibility) **

o  startPrintJob
Start a print job. Everything drawn between startPrintJob
and endPrintJob will become one entry in the print queue.

o  startPrintJob: aString
Start a print job, using aString as the job title; everything
drawn between startPrintJob and endPrintJob will become
one entry in the print queue.

o  startPrintJob: aString fileName: aFileName
Start a print job, using aString as the job title; everything
drawn between startPrintJob and endPrintJob will become
one entry in the print queue.

** This method must be redefined in concrete classes (subclassResponsibility) **

queries
o  supportsColor

o  supportsGraphics

testing
o  isPrinterContext

text printing
o  asArrayOfStringLines: aString in: aRectangle wordWrap: wordWrapBoolean
Private - convert aString into an array of lines; if wordWrapBoolean
is true, also perform word wrapping on the lines, within aRectangle.

o  displayString: aString at: aPoint in: aRect options: ignoredForNow adx: unknownForNow
TaBottom

Usage example(s):

self displayString:aString at:(aPoint x@ aPoint y).

o  displayStringLines: anIndexedCollection from: startIndex to: endIndex in: aRectangle
Private - display Strings in anIndexedCollection starting at startIndex and
ending at endIndex, clipped within the bounds of aRectangle.

o  displayStringLines: anIndexedCollection in: aRectangle
Private - display anIndexedCollection of Strings clipped within
the bounds of aRectangle.

o  displayText: aString at: aPoint

o  linesPerPageFor: aRectangle

o  marginsRectangleFor: aRectangle
Private - Answer a Rectangle defining margins based on aRectangle.
Units for aRectangle are in inches, returned margins rectangle is
in device units (pixels).

o  printPage: pageIndex in: aRectangle lines: lines headerLines: headerLines linesPerPage: linesPerPage
Private - print page # pageIndex from lines, assuming
the given number of linesPerPage.

o  printPage: pageIndex in: aRectangle lines: lines linesPerPage: linesPerPage
Private - print page # pageIndex from lines, assuming
the given number of linesPerPage.

o  stringWidthOf: aString
Return the width of aString
when written using the current font.

o  stringWidthOf: aString at: index
Return the width of aString up to index
when written using the current font; expand tabs out
to 4 spaces for calculations

** This method must be redefined in concrete classes (subclassResponsibility) **



ST/X 7.7.0.0; WebServer 1.702 at 20f6060372b9.unknown:8081; Mon, 18 Nov 2024 06:31:56 GMT