Printer_Lib library

Overview

This is a purebasic user library.

Command Index

Print_About
Print_AdvancedProperties
Print_AngleArc
Print_Arc
Print_Box
Print_Chord
Print_Circle
Print_ConvertPointsToUnitsX
Print_ConvertPointsToUnitsY
Print_ConvertUnitsToPointsX
Print_ConvertUnitsToPointsY
Print_CountFonts
Print_CountPrinters
Print_CreateBrush
Print_CreateBrushIndirect
Print_CreateHatchBrush
Print_CreatePatternBrush
Print_CreatePen
Print_DrawText
Print_Ellipse
Print_EndDocPrinter
Print_EndPagePrinter
Print_EnumFontID
Print_EnumFontName
Print_EnumFontScript
Print_EnumFontStyle
Print_EnumFonts
Print_EnumPrinterName
Print_EnumPrinters
Print_FillRect
Print_Font
Print_FrameRect
Print_GetArcDirection
Print_GetDefaultPrinter
Print_GetDeviceCapabilities
Print_GetDeviceCaps
Print_GetFontFlags
Print_GetFontHeight
Print_GetFontName
Print_GetFontRotate
Print_GetLastError
Print_GetLineColor
Print_GetLineStyle
Print_GetLineWidth
Print_GetOutlineTextMetrics
Print_GetPreviewCount
Print_GetPreviewImage
Print_GetPrintDlg
Print_GetPrinterHandle
Print_GetPrinterName
Print_GetStatus
Print_GetTextAlign
Print_GetTextMetrics
Print_GetUnits
Print_GetX
Print_GetY
Print_GradientFill
Print_Image
Print_InvertRect
Print_Line
Print_LineTo
Print_LoadDEVMODE
Print_NewPage
Print_OpenPrinter
Print_Pie
Print_Plot
Print_PrintDlg
Print_PrintPrefs
Print_Properties
Print_Rectangle
Print_ResetDC
Print_RoundRect
Print_SaveDEVMODE
Print_SetArcDirection
Print_SetBkColor
Print_SetBkMode
Print_SetDEVMODE
Print_SetDebug
Print_SetLineColor
Print_SetLineStyle
Print_SetLineWidth
Print_SetPRINTDLG
Print_SetPRINTDLGEX
Print_SetStatus
Print_SetTextAlign
Print_SetTextColor
Print_SetTextJustification
Print_SetTextSpacing
Print_SetUnits
Print_SetX
Print_SetXY
Print_SetY
Print_StartDoc
Print_StartPreview
Print_StartPrinting
Print_StopPreview
Print_StopPrinting
Print_Text
Print_TextHeight
Print_TextWidth
Print_WriteData
Print_WriteString
Print_WriteStringN


Print_About()

Syntax

Print_About()

Description

Printer_Lib - index


Print_AdvancedProperties()

Syntax

Print_AdvancedProperties(Window.i)

Description

Displays a printer-configuration dialog box for the specified printer.

If the function is successful, the return value is 1.

AdvancedDocumentProperties MSDN-API reference


Print_AngleArc()

Syntax

Print_AngleArc(x.f,y.f,r.f,Startangle.l,Sweepangle.l)

Description

Draws a line segment and an arc.
The line segment is drawn from the current position to the beginning of the arc.
The arc is drawn along the perimeter of a circle with the given radius and center.
The length of the arc is defined by the given start and sweep angles.

x
x-coordinate of circle´s center
y
y-coordinate of circle´s center
r
circle´s radius
startangle
arc´s start angle
sweepangle
arc´s sweep angle

AngleArc MSDN-API reference


Print_Arc()

Syntax

Print_Arc(x1.f,y1.f,x2.f,y2.f,x3.f,y3.f,x4.f,y4.f)

Description

Draws an elliptical arc.

x1
x-coord of rectangle's upper-left corner
y1
y-coord of rectangle's upper-left corner
x2
x-coord of rectangle's lower-right corner
y2
y-coord of rectangle's lower-right corner
x3
x-coord of first radial ending point
y3
y-coord of first radial ending point
x4
x-coord of second radial ending point
y4
y-coord of second radial ending point

Arc MSDN-API reference


Print_Box()

Syntax

Print_Box(x.f, y.f, w.f, h.f [, Fill.l])

Description

Draws a Box. (same as rectangle)

x
x-coord of upper-left corner of rectangle
y
y-coord of upper-left corner of rectangle
w
Width
h
Height
fill
#True = rectangle gets filled

Rectangle MSDN-API reference


Print_Chord()

Syntax

Print_Chord(x1.f,y1.f,x2.f,y2.f,x3.f,y3.f,x4.f,y4.f,Fill.l)

Description

Draws a chord (a region bounded by the intersection of an ellipse and a line segment, called a secant).

x1
x-coord of rectangle's upper-left corner
y1
y-coord of rectangle's upper-left corner
x2
x-coord of rectangle's lower-right corner
y2
y-coord of rectangle's lower-right corner
x3
x-coord of first radial's endpoint
y3
y-coord of first radial's endpoint
x4
x-coord of second radial's endpoint
y4
y-coord of second radial's endpoint
fill
#True = region gets filled

Chord MSDN-API reference


Print_Circle()

Syntax

Print_Circle(x.f,y.f,r.f,Fill.l)

Description

Prints a circle.

x
x-coordinate of the circles center
y
y-coordinate of the circles center
r
radius
fill
#True = the circle gets filled with the current brush-color


Print_ConvertPointsToUnitsX()

Syntax

Print_ConvertPointsToUnitsX(x.l)

Description

Converts between different metric systems.

#PRINT_INCHES
Converts points to inches (with respect of horizontal resolution DPI-X)
#PRINT_MM
Converts points to mm (with respect of horizontal resolution DPI-X)


Print_ConvertPointsToUnitsY()

Syntax

Print_ConvertPointsToUnitsY(y.l)

Description

Converts between different metric systems.

#PRINT_INCHES
Converts points to inches (with respect of horizontal resolution DPI-Y)
#PRINT_MM
Converts points to mm (with respect of horizontal resolution DPI-Y)


Print_ConvertUnitsToPointsX()

Syntax

Print_ConvertUnitsToPointsX(x.f)

Description

Converts between different metric systems.

#PRINT_INCHES
Converts inches to points (with respect of horizontal resolution DPI-X)
#PRINT_MM
Converts mm to points (with respect of horizontal resolution DPI-X)


Print_ConvertUnitsToPointsY()

Syntax

Print_ConvertUnitsToPointsY(y.f)

Description

Converts between different metric systems.

#PRINT_INCHES
Converts inches to points (with respect of horizontal resolution DPI-Y)
#PRINT_MM
Converts mm to points (with respect of horizontal resolution DPI-Y)


Print_CountFonts()

Syntax

Print_CountFonts()

Description

Returns the number of fonts found by Print_EnumFonts()


Print_CountPrinters()

Syntax

Print_CountPrinters()

Description

Returns the number of printers installed


Print_CreateBrush()

Syntax

Print_CreateBrush(Color.l)

Description

Creates a logical brush that has the specified solid color.

CreateSolidBrush MSDN-API reference


Print_CreateBrushIndirect()

Syntax

Print_CreateBrushIndirect(Style.l,Color.l,Hatch.l)

Description

Creates a brush that has the specified style, color, and pattern.

CreateBrushIndirect MSDN-API reference

Example

Create a transparent brush :

Print_CreateBrushIndirect(#BS_HOLLOW,0,0)


Print_CreateHatchBrush()

Syntax

Print_CreateHatchBrush(Style.l,Color.l)

Description

Creates a logical brush that has the specified hatch pattern and color.

CreateHatchBrush MSDN-API reference


Print_CreatePatternBrush()

Syntax

Print_CreatePatternBrush(hBMP.l)

Description

Creates a logical brush with the specified bitmap pattern. The bitmap can be a DIB section bitmap, which is created by the CreateDIBSection function, or it can be a device-dependent bitmap.

CreatePatternBrush MSDN-API reference


Print_CreatePen()

Syntax

Print_CreatePen(Style.l,w.f,Color.l,Stylecount.l,*Style.l)

Description

Creates a logical cosmetic or geometric pen that has the specified style, width, and brush attributes.

ExtCreatePen
MSDN-API reference


Print_DrawText()

Syntax

Print_DrawText(x.f, y.f, w.f, h.f, Text$ [, Format.l [, *RX.l, *RY.l, *RW.l, *RH.l]])

Description

Draws formatted text in the specified rectangle.

x
x-coord of upper-left corner of rectangle
y
y-coord of upper-left corner of rectangle
w
Width
h
Height
format can be a combination of:
#DT_TOP
Justifies the text to the top of the rectangle.
#DT_BOTTOM
Justifies the text to the bottom of the rectangle. This value is used only with the #DT_SINGLELINE value.
#DT_LEFT
Aligns text to the left.
#DT_CENTER
Centers text horizontally in the rectangle.
#DT_RIGHT
Aligns text to the right.
#DT_SINGLELINE
Displays text on a single line only. Carriage returns and line feeds do not break the line.
#DT_VCENTER
Centers text vertically. This value is used only with the DT_SINGLELINE value.
#DT_WORDBREAK
Breaks words.
#DT_CALCRECT
Calculates the rectangle and returns its results in *RX,*RY,*RW,*RH. No text is drawn !

DrawText MSDN-API reference


Print_Ellipse()

Syntax

Print_Ellipse(x1.f,y1.f,x2.f,y2.f,Fill.l)

Description

Draws an ellipse.

x1
x-coord of upper-left corner of rectangle
y1
y-coord of upper-left corner of rectangle
x2
x-coord of lower-right corner of rectangle
y2
y-coord of lower-right corner of rectangle
fill
#True = region gets filled

Ellipse MSDN-API reference


Print_EndDocPrinter()

Syntax

Print_EndDocPrinter()

Description

Ends a print job for the specified printer.

If the function succeeds, the return value is a nonzero value.

EndDocPrinter MSDN-API reference


Print_EndPagePrinter()

Syntax

Print_EndPagePrinter()

Description

Notifies the print spooler that the application is at the end of a page in a print job.

If the function succeeds, the return value is a nonzero value.

EndPagePrinter MSDN-API reference


Print_EnumFontID()

Syntax

Print_EnumFontID(Index.l)

Description

Returns the ID of the font, id starts at index=1.


Print_EnumFontName()

Syntax

Print_EnumFontName(Index.l)

Description

Returns the font name.


Print_EnumFontScript()

Syntax

Print_EnumFontScript(Index.l)

Description

Returns the fonts script name.


Print_EnumFontStyle()

Syntax

Print_EnumFontStyle(Index.l)

Description

Returns the fonts Style.


Print_EnumFonts()

Syntax

Print_EnumFonts([CharSet.b [, Name.s]])

Description

Enumerates all fonts on the system.

CharSet can be one of the following :
#DEFAULT_CHARSET
#ANSI_CHARSET
#BALTIC_CHARSET
#CHINESEBIG5_CHARSET
#EASTEUROPE_CHARSET
#GB2312_CHARSET
#GREEK_CHARSET
#HANGUL_CHARSET
#MAC_CHARSET
#OEM_CHARSET
#RUSSIAN_CHARSET
#SHIFTJIS_CHARSET
#SYMBOL_CHARSET
#TURKISH_CHARSET
#VIETNAMESE_CHARSET
Korean language edition of Windows:
#JOHAB_CHARSET
Middle East language edition of Windows:
#ARABIC_CHARSET
#HEBREW_CHARSET
Thai language edition of Windows:
#THAI_CHARSET

Name of the Font to enumerate i.e. "Arial"

EnumFontFamiliesEx MSDN-API reference


Print_EnumPrinterName()

Syntax

Print_EnumPrinterName(Index.l)

Description

Get the name of the printer, index begins at 0


Print_EnumPrinters()

Syntax

Print_EnumPrinters([enum.l])

Description

Enumerates all Printers

default value for enum is :
#PRINTER_ENUM_LOCAL | #PRINTER_ENUM_CONNECTIONS

possible values are :
#PRINTER_ENUM_LOCAL
#PRINTER_ENUM_NAME
#PRINTER_ENUM_SHARED
#PRINTER_ENUM_DEFAULT
#PRINTER_ENUM_CONNECTIONS
#PRINTER_ENUM_NETWORK
#PRINTER_ENUM_REMOTE


Print_FillRect()

Syntax

Print_FillRect(x1.f,y1.f,x2.f,y2.f)

Description

Fills a rectangle.

x1
x-coord of upper-left corner of rectangle
y1
y-coord of upper-left corner of rectangle
x2
x-coord of lower-right corner of rectangle
y2
y-coord of lower-right corner of rectangle

FillRect MSDN-API reference


Print_Font()

Syntax

Print_Font(Font$, Height.l [, Flags.l [, Rotate.l]])

Description

Changes the current font.

Flags can be a combination of the following :

#PB_Font_Bold
#PB_Font_Italic
#PB_Font_Underline
#PB_Font_StrikeOut
#PB_Font_HighQuality
#PB_Font_HighQuality + 1 = Antialised Quality
#PB_Font_HighQuality + 2 = Cleartype Quality

'Rotate' specifies the angle, in tenths of degrees.

CreateFontIndirect MSDN-API reference


Print_FrameRect()

Syntax

Print_FrameRect(x1.f,y1.f,x2.f,y2.f)

Description

Draws a border around the specified rectangle.
The width and height of the border are always one logical unit.

x1
x-coord of upper-left corner of rectangle
y1
y-coord of upper-left corner of rectangle
x2
x-coord of lower-right corner of rectangle
y2
y-coord of lower-right corner of rectangle

FrameRect MSDN-API reference


Print_GetArcDirection()

Syntax

Print_GetArcDirection()

Description

retrieves the current arc direction.

The return value specifies the current arc direction :
#AD_COUNTERCLOCKWISE
#AD_CLOCKWISE

GetArcDirection MSDN-API reference


Print_GetDefaultPrinter()

Syntax

Print_GetDefaultPrinter()

Description

retrieves the printer name of the default printer for the current user on the local computer.

GetDefaultPrinter MSDN-API reference


Print_GetDeviceCapabilities()

Syntax

Print_GetDeviceCapabilities(Type.l [, Separator$])

Description

Retrieves the capabilities of a printer device driver.

Type can be one of the following :
#DC_BINNAMES
Retrieves the names of the printer's paper bins
#DC_BINS
Retrieves a list of available paper bins
#DC_COLLATE
If the printer supports collating, the return value is 1
#DC_COLORDEVICE (Windows 2000/XP)
If the printer supports color printing, the return value is 1
#DC_COPIES
Returns the number of copies the device can print
#DC_DRIVER
Returns the version number of the printer driver
#DC_DUPLEX
If the printer supports duplex printing, the return value is 1
Note: even when the printer has no duplex option installed it can operate in manual duplex mode
#DC_ENUMRESOLUTIONS
Retrieves a list of the resolutions supported by the printer
#DC_EXTRA
Returns the number of bytes required for the device-specific portion
#DC_FIELDS
Returns the dmFields member of the printer driver's DEVMODE structure
#DC_FILEDEPENDENCIES
Retrieves the names of any additional files that need to be loaded when a driver is installed
#DC_MAXEXTENT
Returns the maximum paper size that the dmPaperLength and dmPaperWidth members of the printer driver's DEVMODE structure can specify
#DC_MEDIAREADY (Windows 2000/XP)
Retrieves the names of the paper forms that are currently available for use
#DC_MEDIATYPENAMES (Windows XP)
Retrieves the names of the supported media types
#DC_MEDIATYPES (Windows XP)
Retrieves a list of supported media types
#DC_MINEXTENT
Returns the minimum paper size that the dmPaperLength and dmPaperWidth members of the printer driver's DEVMODE structure can specify
#DC_ORIENTATION
Returns the relationship between portrait and landscape orientations for a device, in terms of the number of degrees that portrait orientation
is rotated counterclockwise to produce landscape orientation
#DC_NUP (Windows 2000/XP)
Returns the number of pages per printed page (multiple document printing)
#DC_PAPERNAMES
Retrieves a list of supported paper names
#DC_PAPERS
Retrieves a list of supported paper sizes
#DC_PAPERSIZE
Retrieves the dimensions, in tenths of a millimeter, of each supported paper size
#DC_PERSONALITY (Windows 2000/XP)
Retrieves a list of printer description languages supported by the printer
#DC_PRINTERMEM (Windows 2000/XP)
The return value is the amount of available printer memory, in kilobytes
#DC_PRINTRATE (Windows 2000/XP)
The return value indicates the printer's print rate
#DC_PRINTRATEPPM (Windows 2000/XP)
The return value indicates the printer's print rate, in pages per minute
#DC_PRINTRATEUNIT (Windows 2000/XP)
The return value is one of the following values that indicate the print rate units for the value returned for the DC_PRINTRATE flag
#PRINTRATEUNIT_CPS Characters per second.
#PRINTRATEUNIT_IPM Inches per minute.
#PRINTRATEUNIT_LPM Lines per minute.
#PRINTRATEUNIT_PPM Pages per minute.
#DC_SIZE
Returns the dmSize member of the printer driver's DEVMODE structure
#DC_STAPLE (Windows 2000/XP)
If the printer supports stapling, the return value is a nonzero value
#DC_TRUETYPE
Retrieves the abilities of the driver to use TrueType fonts
#DCTT_BITMAP Device can print TrueType fonts as graphics.
#DCTT_DOWNLOAD Device can down-load TrueType fonts.
#DCTT_DOWNLOAD_OUTLINE Windows 95/98/Me: Device can download outline TrueType fonts.
#DCTT_SUBDEV Device can substitute device fonts for TrueType fonts.
#DC_VERSION
Returns the specification version to which the printer driver conforms

Serparator$
User defined separator (default = | )
DeviceCapabilities MSDN-API reference

Example

Debug Print_GetDeviceCapabilities(#DC_NUP)
6|1|2|4|6|9|16


Print_GetDeviceCaps()

Syntax

Print_GetDeviceCaps(Type.l)

Description

Type can be one of the following:

#HORZSIZE
Width, in millimeters

#VERTSIZE
Height, in millimeters

#HORZRES
Width, in pixels

#VERTRES
Height, in raster lines

#LOGPIXELSX
Number of pixels per logical inch

#LOGPIXELSY
Number of pixels per logical inch

#PHYSICALWIDTH
The width of the physical page, in device units.

#PHYSICALHEIGHT
The height of the physical page, in device units.

#PHYSICALOFFSETX
The distance from the left edge of the physical page to the left edge of the printable area, in device units.

#PHYSICALOFFSETY
The distance from the top edge of the physical page to the top edge of the printable area, in device units.

#SCALINGFACTORX
Scaling factor for the x-axis of the printer.

#SCALINGFACTORY
Scaling factor for the y-axis of the printer.

MSDN GetDeviceCaps API reference


Print_GetFontFlags()

Syntax

Print_GetFontFlags()

Description

Gets the current font flags.


Print_GetFontHeight()

Syntax

Print_GetFontHeight()

Description

Gets the current font height.


Print_GetFontName()

Syntax

Print_GetFontName()

Description

Gets the current font name.


Print_GetFontRotate()

Syntax

Print_GetFontRotate()

Description

Gets the current font rotation in tenths of degrees.


Print_GetLastError()

Syntax

Print_GetLastError()

Description

Translates the last error code to formatted text using the current language id.

GetLastError MSDN-API reference

GetUserDefaultLangID MSDN-API reference

FormatMessage MSDN-API reference


Print_GetLineColor()

Syntax

Print_GetLineColor()

Description

Returns the current linecolor.


Print_GetLineStyle()

Syntax

Print_GetLineStyle()

Description

Returns the current linestyle.


Print_GetLineWidth()

Syntax

Print_GetLineWidth()

Description

Returns the current linewidth.


Print_GetOutlineTextMetrics()

Syntax

Print_GetOutlineTextMetrics(Type.l)

Description

Retrieves text metrics for TrueType fonts.

#TM_HEIGHT
#TM_ASCENT
#TM_DESCENT
#TM_INTERNALLEADING
#TM_EXTERNALLEADING
#TM_AVECHARWIDTH
#TM_MAXCHARWIDTH
#TM_WEIGHT
#TM_OVERHANG
#TM_DIGITIZEDASPECTX
#TM_DIGITIZEDASPECTY
#TM_FIRSTCHAR
#TM_LASTCHAR
#TM_DEFAULTCHAR
#TM_BREAKCHAR
#TM_ITALIC
#TM_UNDERLINED
#TM_STRUCKOUT
#TM_PITCHANDFAMILY
#TM_CHARSET
#OTM_FILLER
#OTM_PANOSE_TYPE
#OTM_PANOSE_STYLE
#OTM_PANOSE_WEIGHT
#OTM_PANOSE_PROPORTION
#OTM_PANOSE_CONTRAST
#OTM_PANOSE_STROKEV
#OTM_PANOSE_ARMSTYLE
#OTM_PANOSE_LETTERFORM
#OTM_PANOSE_MIDLINE
#OTM_PANOSE_XHEIGHT
#OTM_FSSELECTION
#OTM_FSTYPE
#OTM_SCHARSLOPERISE
#OTM_SCHARSLOPERUN
#OTM_IIALICANGLE
#OTM_EMSQUARE
#OTM_ASCENT
#OTM_DESCENT
#OTM_LINEGAP
#OTM_CAPEMHEIGHT
#OTM_XHEIGHT
#OTM_RCFONTBOX_LEFT
#OTM_RCFONTBOX_TOP
#OTM_RCFONTBOX_RIGHT
#OTM_RCFONTBOX_BOTTOM
#OTM_MACASCENT
#OTM_MACDESCENT
#OTM_MACLINEGAP
#OTM_USMINIMUMPPEM
#OTM_PTSUBSCRIPTSIZEX
#OTM_PTSUBSCRIPTSIZEY
#OTM_PTSUBSCRIPTOFFSETX
#OTM_PTSUBSCRIPTOFFSETY
#OTM_PTSUPERSCRIPTSIZEX
#OTM_PTSUPERSCRIPTSIZEY
#OTM_PTSUPERSCRIPTOFFSETX
#OTM_PTSUPERSCRIPTOFFSETY
#OTM_SSTRIKEOUTSIZE
#OTM_SSTRIKEOUTPOSITION
#OTM_SUNDERSCORESIZE
#OTM_SUNDERSCOREPOSITION
#OTM_PFAMILYNAME
#OTM_PFACENAME
#OTM_PSTYLENAME
#OTM_PFULLNAME

GetOutlineTextMetrics MSDN-API reference

OUTLINETEXTMETRIC structure MSDN-API reference


Print_GetPreviewCount()

Syntax

Print_GetPreviewCount()

Description

Gets the amount of pages from a Preview job.


Print_GetPreviewImage()

Syntax

Print_GetPreviewImage(Index.l)

Description

Gets the imageID of a preview job.

index
index of the image (starting at 0)

Example

idx=0
img=Print_GetPreviewImage(idx)
If img
   SetGadgetState(1,UseImage(img))
EndIf


Print_GetPrintDlg()

Syntax

Print_GetPrintDlg()

Description

Returns the Pointer to the PrintDLG variable.

Example

Print_PrintDlg(0,"","","FLAGS=2,NFROMPAGE=2,NTOPAGE=3,NMAXPAGE=999")
*Test.PRINTDLG=Print_GetPrintDlg()
Debug *Test\nFromPage
Debug *Test\nToPage


Print_GetPrinterHandle()

Syntax

Print_GetPrinterHandle()

Description

Returns the printerhandle of a previously opened printer.


Print_GetPrinterName()

Syntax

Print_GetPrinterName()

Description

Gets the name of the currently used printer


Print_GetStatus()

Syntax

Print_GetStatus(Type.l)

Description

Retrieves information about a specified printer.

type can be one of the following :
#PRINT_ATTRIBUTES the printers attributes will be returned :
#PRINT_STATUS the printers status will be returned

Return values for attribute are :
#PRINTER_ATTRIBUTE_DEFAULT
Windows 95/98/Me: Indicates the printer is the default printer in the system.
#PRINTER_ATTRIBUTE_DIRECT
Job is sent directly to the printer (it is not spooled).
#PRINTER_ATTRIBUTE_DO_COMPLETE_FIRST
If set and printer is set for print-while-spooling, any jobs that have completed spooling are scheduled to print before jobs that have not completed spooling.
#PRINTER_ATTRIBUTE_ENABLE_BIDI
Windows 95/98/Me: Indicates whether bi-directional communications are enabled for the printer.
#PRINTER_ATTRIBUTE_ENABLE_DEVQ
If set, DevQueryPrint is called. DevQueryPrint may fail if the document and printer setups do not match. Setting this flag causes mismatched documents to be held in the queue.
#PRINTER_ATTRIBUTE_FAX
Windows XP: If set, printer is a fax printer. This can only be set by AddPrinter, but it can be retrieved by EnumPrinters and GetPrinter.
#PRINTER_ATTRIBUTE_KEEPPRINTEDJOBS
If set, jobs are kept after they are printed. If unset, jobs are deleted.
#PRINTER_ATTRIBUTE_QUEUED
If set, the printer spools and starts printing after the last page is spooled. If not set and PRINTER_ATTRIBUTE_DIRECT is not set, the printer spools and prints while spooling.
#PRINTER_ATTRIBUTE_SHARED
Printer is shared.
#PRINTER_ATTRIBUTE_WORK_OFFLINE
Windows 95/98/Me: Indicates whether the printer is currently connected. If the printer is not currently connected, print jobs will continue to spool.
#PRINTER_ATTRIBUTE_PUBLISHED
Windows 2000/XP: Indicates whether the printer is published in the directory service.
#PRINTER_ATTRIBUTE_NETWORK
Printer is a network printer connection.
#PRINTER_ATTRIBUTE_HIDDEN
Reserved.
#PRINTER_ATTRIBUTE_LOCAL
Printer is a local printer.
#PRINTER_ATTRIBUTE_RAW_ONLY
Indicates that only raw data type print jobs can be spooled.

Return values for status are :
#PRINTER_STATUS_BUSY
The printer is busy.
#PRINTER_STATUS_DOOR_OPEN
The printer door is open.
#PRINTER_STATUS_ERROR
The printer is in an error state.
#PRINTER_STATUS_INITIALIZING
The printer is initializing.
#PRINTER_STATUS_IO_ACTIVE
The printer is in an active input/output state
#PRINTER_STATUS_MANUAL_FEED
The printer is in a manual feed state.
#PRINTER_STATUS_NO_TONER
The printer is out of toner.
#PRINTER_STATUS_NOT_AVAILABLE
The printer is not available for printing.
#PRINTER_STATUS_OFFLINE
The printer is offline.
#PRINTER_STATUS_OUT_OF_MEMORY
The printer has run out of memory.
#PRINTER_STATUS_OUTPUT_BIN_FULL
The printer's output bin is full.
#PRINTER_STATUS_PAGE_PUNT
The printer cannot print the current page.
Windows 95/98/Me: Indicates the page is being "punted" (that is, not printed)
because it is too complex for the printer to print.
#PRINTER_STATUS_PAPER_JAM
Paper is jammed in the printer
#PRINTER_STATUS_PAPER_OUT
The printer is out of paper.
#PRINTER_STATUS_PAPER_PROBLEM
The printer has a paper problem.
#PRINTER_STATUS_PAUSED
The printer is paused.
#PRINTER_STATUS_PENDING_DELETION
The printer is being deleted.
#PRINTER_STATUS_POWER_SAVE
The printer is in power save mode.
#PRINTER_STATUS_PRINTING
The printer is printing.
#PRINTER_STATUS_PROCESSING
The printer is processing a print job.
#PRINTER_STATUS_SERVER_UNKNOWN
The printer status is unknown.
#PRINTER_STATUS_TONER_LOW
The printer is low on toner.
#PRINTER_STATUS_USER_INTERVENTION
The printer has an error that requires the user to do something.
#PRINTER_STATUS_WAITING
The printer is waiting.
#PRINTER_STATUS_WARMING_UP
The printer is warming up.

GetPrinter MSDN-API reference


Print_GetTextAlign()

Syntax

Print_GetTextAlign()

Description

Gets the text-alignment flags.

Return values are :
#TA_BASELINE (24)
The reference point will be on the base line of the text.
#TA_BOTTOM (8)
The reference point will be on the bottom edge of the bounding rectangle.
#TA_TOP (0)
The reference point will be on the top edge of the bounding rectangle.
#TA_CENTER (6)
The reference point will be aligned horizontally with the center of the bounding rectangle.
#TA_LEFT (0)
The reference point will be on the left edge of the bounding rectangle.
#TA_RIGHT (2)
The reference point will be on the right edge of the bounding rectangle.
#TA_NOUPDATECP (0)
The current position is not updated after each text output call. The reference point is passed to the text output function.
#TA_UPDATECP (1)
The current position is updated after each text output call. The current position is used as the reference point.
#TA_RTLREADING (256)
Middle East language edition of Windows:
The text is laid out in right to left reading order, as opposed to the default left to right order.
This only applies when the font selected into the device context is either Hebrew or Arabic.

GetTextAlign MSDN-API reference

Example

TA=Print_GetTextAlign()
Select TA & 6
   Case #TA_CENTER ; 6
      Debug "#TA_CENTER"
   Case #TA_RIGHT ; 2
      Debug "#TA_RIGHT"
   Default
      Debug "#TA_LEFT"
EndSelect

Select TA & 24
   Case #TA_BOTTOM ; 8
      Debug "#TA_BOTTOM"
   Case #TA_BASELINE ; 24
      Debug "#TA_BASELINE"
   Default ; 0
      Debug "#TA_TOP"
EndSelect

Select TA & 1
   Case #TA_UPDATECP
      Debug "#TA_UPDATECP"
   Default
      Debug "#TA_NOUPDATECP"
EndSelect

Select TA & 256
   Case 256 ; #TA_RTLREADING
      Debug "#TA_RTLREADING"
EndSelect


Print_GetTextMetrics()

Syntax

Print_GetTextMetrics(Type.l)

Description

Gets metrics for the currently selected font.

'Type' can be one of the following :

#TM_HEIGHT
Specifies the height (ascent + descent) of characters.
#TM_ASCENT
Specifies the ascent (units above the base line) of characters.
#TM_DESCENT
Specifies the descent (units below the base line) of characters.
#TM_INTERNALLEADING
Specifies the amount of leading (space) inside the bounds set by the tmHeight member.
Accent marks and other diacritical characters may occur in this area.
The designer may set this member to zero.
#TM_EXTERNALLEADING
Specifies the amount of extra leading (space) that the application adds between rows.
Since this area is outside the font, it contains no marks and is not altered by text output calls
in either OPAQUE or TRANSPARENT mode. The designer may set this member to zero.
#TM_AVECHARWIDTH
Specifies the average width of characters in the font (generally defined as the width of the letter x).
This value does not include the overhang required for bold or italic characters.
#TM_MAXCHARWIDTH
Specifies the width of the widest character in the font.
#TM_WEIGHT
Specifies the weight of the font.
#TM_OVERHANG
Specifies the extra width per string that may be added to some synthesized fonts.
When synthesizing some attributes, such as bold or italic,
graphics device interface (GDI) or a device may have to add width to a string
on both a per-character and per-string basis. For example, GDI makes a string bold
by expanding the spacing of each character and overstriking by an offset value;
it italicizes a font by shearing the string. In either case, there is an overhang
past the basic string. For bold strings, the overhang is the distance by which
the overstrike is offset. For italic strings, the overhang is the amount the top of
the font is sheared past the bottom of the font.
The tmOverhang member enables the application to determine how much of the character width
returned by a GetTextExtentPoint32 function call on a single character is the actual character width
and how much is the per-string extra width. The actual width is the extent minus the overhang.
#TM_DIGITIZEDASPECTX
Specifies the horizontal aspect of the device for which the font was designed.
#TM_DIGITIZEDASPECTY
Specifies the vertical aspect of the device for which the font was designed.
The ratio of the tmDigitizedAspectX and tmDigitizedAspectY members is the aspect ratio
of the device for which the font was designed.
#TM_FIRSTCHAR
Specifies the value of the first character defined in the font.
#TM_LASTCHAR
Specifies the value of the last character defined in the font.
#TM_DEFAULTCHAR
Specifies the value of the character to be substituted for characters not in the font.
#TM_BREAKCHAR
Specifies the value of the character that will be used to define word breaks for text justification.
#TM_ITALIC
Specifies an italic font if it is nonzero.
#TM_UNDERLINED
Specifies an underlined font if it is nonzero.
#TM_STRUCKOUT
Specifies a strikeout font if it is nonzero.
#TM_PITCHANDFAMILY
Specifies information about the pitch, the technology, and the family of a physical font.
#TM_CHARSET
Specifies the character set of the font. The character set can be one of the following values.
#ANSI_CHARSET
#BALTIC_CHARSET
#CHINESEBIG5_CHARSET
#DEFAULT_CHARSET
#EASTEUROPE_CHARSET
#GB2312_CHARSET
#GREEK_CHARSET
#HANGUL_CHARSET
#MAC_CHARSET
#OEM_CHARSET
#RUSSIAN_CHARSET
#SHIFTJIS_CHARSET
#SYMBOL_CHARSET
#TURKISH_CHARSET
#VIETNAMESE_CHARSET
#JOHAB_CHARSET (Korean language edition of Windows)
#ARABIC_CHARSET (Middle East language edition of Windows)
#HEBREW_CHARSET (Middle East language edition of Windows)
#THAI_CHARSET (Thai language edition of Windows)

GetTextMetrics MSDN-API reference

TEXTMETRIC structure MSDN-API reference


Print_GetUnits()

Syntax

Print_GetUnits()

Description

Gets the current selected unit :

#PRINT_POINTS
all coordinates are given in pixel
#PRINT_INCHES
all coordinates are given in inches
#PRINT_MM
all coordinates are given in mm


Print_GetX()

Syntax

Print_GetX()

Description

Retrieves the current x-coordinate in logical units.

GetCurrentPositionEx MSDN-API reference


Print_GetY()

Syntax

Print_GetY()

Description

Retrieves the current y-coordinate in logical units.

GetCurrentPositionEx MSDN-API reference


Print_GradientFill()

Syntax

Print_GradientFill(*Vertex,NumVertex.l,*Mesh,NumMesh.l,Mode.l)

Description

The GradientFill function fills rectangle and triangle structures.

*Vertex = array of vertices
NumVertex = number of vertices
*Mesh = array of gradients
NumMesh = size of gradient array
Mode = gradient fill mode. can be one of the following :
#GRADIENT_FILL_RECT_H
#GRADIENT_FILL_RECT_V
#GRADIENT_FILL_TRIANGLE

GradientFill MSDN-API reference


Print_Image()

Syntax

Print_Image(Imagenr.l, x.f, y.f [, w.f, h.f])

Description

Prints an image.

imageid
imageid. The imageid must exist (see LoadImage / CreateImage in the PB docs)
x
Specifies the x-coordinate.
y
Specifies the y-coordinate.
w
width of the image
h
height of the image
mode
normally #SRCCOPY

CreateCompatibleDC MSDN-API reference

StretchBlt MSDN-API reference


Print_InvertRect()

Syntax

Print_InvertRect(x1.f,y1.f,x2.f,y2.f)

Description

Inverts a rectangle.

x1
x-coord of upper-left corner of rectangle
y1
y-coord of upper-left corner of rectangle
x2
x-coord of lower-right corner of rectangle
y2
y-coord of lower-right corner of rectangle

InvertRect MSDN-API reference


Print_Line()

Syntax

Print_Line(x.f,y.f,w.f,h.f)

Description

Draws a line.

x
Specifies the x-coordinate.
y
Specifies the y-coordinate.
w
width
h
height

Line MSDN-API reference


Print_LineTo()

Syntax

Print_LineTo(x.f,y.f)

Description

Draws a line from the current position up to, but not including, the specified point.

x
x-coordinate of ending point
x
y-coordinate of ending point

Line MSDN-API reference


Print_LoadDEVMODE()

Syntax

Print_LoadDEVMODE(Filename$)

Description

Loads a DEVMODE structure from file


Print_NewPage()

Syntax

Print_NewPage()

Description

Opens a new page.

If the function succeeds, the return value is greater than zero.

EndPage MSDN-API reference


Print_OpenPrinter()

Syntax

Print_OpenPrinter([Printername$ [, Option$ [, Access.l]]])

Description

PrinterName$
PrinterName (leave blank for the standard printer)

Option$
Options in the form of keyword value pairs separated with kommas "," :
ORIENTATION=
Selects the orientation of the paper.
#DMORIENT_PORTRAIT #DMORIENT_LANDSCAPE

PAPERSIZE=
Selects the size of the paper to print on.
#DMPAPER_LETTER #DMPAPER_LEGAL #DMPAPER_A4 ...

PAPERLENGTH=
Specifies the length in tenths of a millimeter.

PAPERWIDTH=
Specifies the width

SCALE=
Specifies the factor by which the printed output is to be scaled.

COPIES=
Selects the number of copies printed if the device supports multiple-page copies.

DEFAULTSOURCE=
Specifies the paper source.
#DMBIN_AUTO #DMBIN_CASSETTE #DMBIN_ENVELOPE #DMBIN_ENVMANUAL #DMBIN_FORMSOURCE #DMBIN_LARGECAPACITY
#DMBIN_LARGEFMT #DMBIN_LOWER #DMBIN_MANUAL #DMBIN_MIDDLE #DMBIN_ONLYONE #DMBIN_TRACTOR #DMBIN_SMALLFMT

PRINTQUALITY=
Specifies the printer resolution.
#DMRES_HIGH #DMRES_MEDIUM #DMRES_LOW #DMRES_DRAFT

COLOR=
Switches between color and monochrome on color printers.
#DMCOLOR_COLOR #DMCOLOR_MONOCHROME

DUPLEX=
Selects duplex or double-sided printing for printers capable of duplex printing.
#DMDUP_SIMPLEX #DMDUP_HORIZONTAL #DMDUP_VERTICAL

YRESOLUTION=
Specifies the y-resolution, in dots per inch, of the printer.

TTOPTION=
Specifies how TrueType fonts should be printed.
#DMTT_BITMAP #DMTT_DOWNLOAD #DMTT_DOWNLOAD_OUTLINE #DMTT_SUBDEV

COLLATE=
Specifies whether collation should be used when printing multiple copies.
#DMCOLLATE_TRUE #DMCOLLATE_FALSE

The returned value is the DC (Device context)

OpenPrinter MSDN-API reference

Example

OPT$="ORIENTATION="+Str(#DMORIENT_PORTRAIT)+","
OPT$+"PAPERSIZE="+Str(#DMPAPER_A4)
If Print_OpenPrinter("",OPT$)
   ; Code
Else
; no printer available
EndIf


Print_Pie()

Syntax

Print_Pie(x1.f,y1.f,x2.f,y2.f,x3.f,y3.f,x4.f,y4.f,Fill.l)

Description

Draws a pie-shaped wedge bounded by the intersection of an ellipse and two radials.

x1
x-coord of upper-left corner of rectangle
y1
y-coord of upper-left corner of rectangle
x2
x-coord of lower-right corner of rectangle
y2
y-coord of lower-right corner of rectangle
x3
x-coord of first radial's endpoint
y3
y-coord of first radial's endpoint
x4
x-coord of second radial's endpoint
y4
y-coord of second radial's endpoint
fill
#True = the pie gets filled

Pie MSDN-API reference


Print_Plot()

Syntax

Print_Plot(x.f,y.f)

Description

Draws a Plot at the given coordinates.

x
Specifies the x-coordinate.
y
Specifies the y-coordinate.

Line MSDN-API reference


Print_PrintDlg()

Syntax

Print_PrintDlg(Window.i [, Printername$ [, Option1$ [, Option2$]]])

Description

Displays a Print Dialog Box.

Options in the form of keyword value pairs separated with kommas "," :

Option1$ (same as Print_OpenPrinter)
ORIENTATION=
Selects the orientation of the paper.
#DMORIENT_PORTRAIT #DMORIENT_LANDSCAPE

PAPERSIZE=
Selects the size of the paper to print on.
#DMPAPER_LETTER #DMPAPER_LEGAL #DMPAPER_A4 ...

PAPERLENGTH=
Specifies the length in tenths of a millimeter.

PAPERWIDTH=
Specifies the width

SCALE=
Specifies the factor by which the printed output is to be scaled.

COPIES=
Selects the number of copies printed if the device supports multiple-page copies.

DEFAULTSOURCE=
Specifies the paper source.
#DMBIN_AUTO #DMBIN_CASSETTE #DMBIN_ENVELOPE #DMBIN_ENVMANUAL #DMBIN_FORMSOURCE #DMBIN_LARGECAPACITY
#DMBIN_LARGEFMT #DMBIN_LOWER #DMBIN_MANUAL #DMBIN_MIDDLE #DMBIN_ONLYONE #DMBIN_TRACTOR #DMBIN_SMALLFMT

PRINTQUALITY=
Specifies the printer resolution.
#DMRES_HIGH #DMRES_MEDIUM #DMRES_LOW #DMRES_DRAFT

COLOR=
Switches between color and monochrome on color printers.
#DMCOLOR_COLOR #DMCOLOR_MONOCHROME

DUPLEX=
Selects duplex or double-sided printing for printers capable of duplex printing.
#DMDUP_SIMPLEX #DMDUP_HORIZONTAL #DMDUP_VERTICAL

YRESOLUTION=
Specifies the y-resolution, in dots per inch, of the printer.

TTOPTION=
Specifies how TrueType fonts should be printed.
#DMTT_BITMAP #DMTT_DOWNLOAD #DMTT_DOWNLOAD_OUTLINE #DMTT_SUBDEV

COLLATE=
Specifies whether collation should be used when printing multiple copies.
#DMCOLLATE_TRUE #DMCOLLATE_FALSE

Option2$ (Sets defaults for the dialog)
FLAGS=
A set of bit flags that you can use to initialize the Print property sheet.
NFROMPAGE=
Specifies the initial value for the starting page.
NTOPAGE=
Specifies the initial value for the ending page.
NMINPAGE=
Specifies the minimum value for the page ranges.
NMAXPAGE=
Specifies the maximum value for the page ranges.
NCOPIES=
Contains the initial number of copies.

If the user clicks the OK button, the return value is the DC (Device context).

Displays a Print Dialog Box.

PrintDlg MSDN-API reference


Print_PrintPrefs()

Syntax

Print_PrintPrefs([Window.i [, PrinterName$]])

Description

Opens the printers documentproperties.
On success it returns a pointer to a DEVMODE structure.

Window handle to parent window
PrinterName$ device name


Print_Properties()

Syntax

Print_Properties(Window.i)

Description

Displays a printer-properties property sheet for the specified printer.

Window
Is a windowid of an open window

If the function succeeds, the return value is a nonzero value.

PrinterProperties MSDN-API reference


Print_Rectangle()

Syntax

Print_Rectangle(x.f, y.f, w.f, h.f [, Fill.l])

Description

Draws a rectangle.

x
x-coord of upper-left corner of rectangle
y
y-coord of upper-left corner of rectangle
w
Width
h
Height
fill
#True = rectangle gets filled

Rectangle MSDN-API reference


Print_ResetDC()

Syntax

Print_ResetDC(Option$)

Description

Resets the printerparameters for an opened printer.

Option$
Options in the form of keyword value pairs separated with kommas "," :
ORIENTATION=
Selects the orientation of the paper.
#DMORIENT_PORTRAIT #DMORIENT_LANDSCAPE

PAPERSIZE=
Selects the size of the paper to print on.
#DMPAPER_LETTER #DMPAPER_LEGAL #DMPAPER_A4 ...

PAPERLENGTH=
Specifies the length in tenths of a millimeter.

PAPERWIDTH=
Specifies the width

SCALE=
Specifies the factor by which the printed output is to be scaled.

COPIES=
Selects the number of copies printed if the device supports multiple-page copies.

DEFAULTSOURCE=
Specifies the paper source.
#DMBIN_AUTO #DMBIN_CASSETTE #DMBIN_ENVELOPE #DMBIN_ENVMANUAL #DMBIN_FORMSOURCE #DMBIN_LARGECAPACITY
#DMBIN_LARGEFMT #DMBIN_LOWER #DMBIN_MANUAL #DMBIN_MIDDLE #DMBIN_ONLYONE #DMBIN_TRACTOR #DMBIN_SMALLFMT

PRINTQUALITY=
Specifies the printer resolution.
#DMRES_HIGH #DMRES_MEDIUM #DMRES_LOW #DMRES_DRAFT

COLOR=
Switches between color and monochrome on color printers.
#DMCOLOR_COLOR #DMCOLOR_MONOCHROME

DUPLEX=
Selects duplex or double-sided printing for printers capable of duplex printing.
#DMDUP_SIMPLEX #DMDUP_HORIZONTAL #DMDUP_VERTICAL

YRESOLUTION=
Specifies the y-resolution, in dots per inch, of the printer.

TTOPTION=
Specifies how TrueType fonts should be printed.
#DMTT_BITMAP #DMTT_DOWNLOAD #DMTT_DOWNLOAD_OUTLINE #DMTT_SUBDEV

COLLATE=
Specifies whether collation should be used when printing multiple copies.
#DMCOLLATE_TRUE #DMCOLLATE_FALSE

ResetDC MSDN-API reference


Print_RoundRect()

Syntax

Print_RoundRect(x1.f,y1.f,x2.f,y2.f,w.f,h.f,Fill.l)

Description

Draws a rectangle with rounded corners.

x1
x-coord of upper-left corner of rectangle
y1
y-coord of upper-left corner of rectangle
x2
x-coord of lower-right corner of rectangle
y2
y-coord of lower-right corner of rectangle
w
width of ellipse
h
height of ellipse
fill
#True = rectangle gets filled

RoundRect MSDN-API reference


Print_SaveDEVMODE()

Syntax

Print_SaveDEVMODE(Filename$)

Description

Saves a DEVMODE structure to file


Print_SetArcDirection()

Syntax

Print_SetArcDirection(arcd.l)

Description

Sets the drawing direction to be used for arc and rectangle functions.

'arcd' specifies the new arc direction :

#AD_COUNTERCLOCKWISE
#AD_CLOCKWISE

SetArcDirection MSDN-API reference


Print_SetBkColor()

Syntax

Print_SetBkColor(Color.l)

Description

Sets the current background color to the specified color value.
This function fills the gaps between styled lines.
This function also sets the background colors for TextOut and ExtTextOut.

SetBkColor MSDN-API reference


Print_SetBkMode()

Syntax

Print_SetBkMode(Mode.l)

Description

Sets the background mix mode.

'Mode' can be one of the following :

#OPAQUE
Background is filled with the current background color before the text, hatched brush, or pen is drawn.
#TRANSPARENT
Background remains untouched.

SetBkMode MSDN-API reference


Print_SetDEVMODE()

Syntax

Print_SetDEVMODE(Option$,*PrinterParameters.DEVMODE)

Description

Set a DEVMODE structure pointed to by *PrinterParameters.

Option$
Options in the form of keyword value pairs separated with kommas "," :
ORIENTATION=
Selects the orientation of the paper.
#DMORIENT_PORTRAIT #DMORIENT_LANDSCAPE

PAPERSIZE=
Selects the size of the paper to print on.
#DMPAPER_LETTER #DMPAPER_LEGAL #DMPAPER_A4 ...

PAPERLENGTH=
Specifies the length in tenths of a millimeter.

PAPERWIDTH=
Specifies the width

SCALE=
Specifies the factor by which the printed output is to be scaled.

COPIES=
Selects the number of copies printed if the device supports multiple-page copies.

DEFAULTSOURCE=
Specifies the paper source.
#DMBIN_AUTO #DMBIN_CASSETTE #DMBIN_ENVELOPE #DMBIN_ENVMANUAL #DMBIN_FORMSOURCE #DMBIN_LARGECAPACITY
#DMBIN_LARGEFMT #DMBIN_LOWER #DMBIN_MANUAL #DMBIN_MIDDLE #DMBIN_ONLYONE #DMBIN_TRACTOR #DMBIN_SMALLFMT

PRINTQUALITY=
Specifies the printer resolution.
#DMRES_HIGH #DMRES_MEDIUM #DMRES_LOW #DMRES_DRAFT

COLOR=
Switches between color and monochrome on color printers.
#DMCOLOR_COLOR #DMCOLOR_MONOCHROME

DUPLEX=
Selects duplex or double-sided printing for printers capable of duplex printing.
#DMDUP_SIMPLEX #DMDUP_HORIZONTAL #DMDUP_VERTICAL

YRESOLUTION=
Specifies the y-resolution, in dots per inch, of the printer.

TTOPTION=
Specifies how TrueType fonts should be printed.
#DMTT_BITMAP #DMTT_DOWNLOAD #DMTT_DOWNLOAD_OUTLINE #DMTT_SUBDEV

COLLATE=
Specifies whether collation should be used when printing multiple copies.
#DMCOLLATE_TRUE #DMCOLLATE_FALSE


Print_SetDebug()

Syntax

Print_SetDebug(Mode.l)

Description

This switch is for debugging this library.
Set mode to #True switches on this function.

Example

Print_SetDebug(#True)


Print_SetLineColor()

Syntax

Print_SetLineColor(Color.l)

Description

Sets the linecolor.

Example

Print_SetLineColor(#Red)


Print_SetLineStyle()

Syntax

Print_SetLineStyle(Style.l)

Description

Sets the linestyle.

It can be a combination of type, style and endcaps

Type :
#PS_GEOMETRIC
#PS_COSMETIC

Style :
#PS_ALTERNATE
#PS_SOLID
#PS_DASH
#PS_DOT
#PS_DASHDOT
#PS_DASHDOTDOT
#NULL
#PS_USERSTYLE
#PS_INSIDEFRAME

Endcaps :
#PS_ENDCAP_ROUND
#PS_ENDCAP_SQUARE
#PS_ENDCAP_FLAT

Join:
#PS_JOIN_BEVEL
#PS_JOIN_MITER
#PS_JOIN_ROUND

Example

endcaps are round :
Print_SetLineStyle(#PS_GEOMETRIC|#PS_SOLID|#PS_ENDCAP_ROUND|#PS_JOIN_MITER)

endcaps are flat :
Print_SetLineStyle(#PS_GEOMETRIC|#PS_SOLID|#PS_ENDCAP_FLAT|#PS_JOIN_MITER)


Print_SetLineWidth()

Syntax

Print_SetLineWidth(w.f)

Description

Sets the linewidth.

Example

Print_SetLineWidth(0.2)


Print_SetPRINTDLG()

Syntax

Print_SetPRINTDLG(Option$,*PrinterParameters.PRINTDLG)

Description

Sets the values of a PRINTDLG structure.


Print_SetPRINTDLGEX()

Syntax

Print_SetPRINTDLGEX(Option$,*PrinterParameters.PRINTDLGEX)

Description

Sets the values of a PRINTDLGEX structure.


Print_SetStatus()

Syntax

Print_SetStatus(Status.l)

Description

Sets the printerstatus.

status can be one of the following :

#PRINTER_CONTROL_PAUSE
#PRINTER_CONTROL_PURGE
#PRINTER_CONTROL_RESUME

Note : #PRINTER_ALL_ACCESS must be used at Print_OpenPrinter or the operation fails with the error #ERROR_ACCESS_DENIED

SetPrinter MSDN-API reference

Example

If Print_OpenPrinter("","",#PRINTER_ALL_ACCESS)
   If Print_SetStatus(#PRINTER_CONTROL_PAUSE)=0
      Debug Print_GetLastError()
   Else
      Debug "Printer paused"
   EndIf
Else
   Debug Print_GetLastError()
EndIf


Print_SetTextAlign()

Syntax

Print_SetTextAlign(Mode.l)

Description

Sets the text-alignment flags.

'Mode' can be a comination of :
#TA_BASELINE
The reference point will be on the base line of the text.
#TA_BOTTOM
The reference point will be on the bottom edge of the bounding rectangle.
#TA_TOP
The reference point will be on the top edge of the bounding rectangle.
#TA_CENTER
The reference point will be aligned horizontally with the center of the bounding rectangle.
#TA_LEFT
The reference point will be on the left edge of the bounding rectangle.
#TA_RIGHT
The reference point will be on the right edge of the bounding rectangle.
#TA_NOUPDATECP
The current position is not updated after each text output call. The reference point is passed to the text output function.
#TA_UPDATECP
The current position is updated after each text output call. The current position is used as the reference point.

When the current font has a vertical default base line, as with Kanji,
the following values must be used instead of TA_BASELINE and TA_CENTER.
#VTA_BASELINE
The reference point will be on the base line of the text.
#VTA_CENTER
The reference point will be aligned vertically with the center of the bounding rectangle.

SetTextAlign MSDN-API reference

Example

Print_SetTextAlign(#TA_LEFT|#TA_TOP|#TA_NOUPDATECP)


Print_SetTextColor()

Syntax

Print_SetTextColor(Color.l)

Description

Sets the text color.

SetTextColor MSDN-API reference

Example

Print_SetTextColor(#Black)


Print_SetTextJustification()

Syntax

Print_SetTextJustification(l.f,Count.l)

Description

Specifies the amount of space the system should add to the break characters in a string of text.

'l' length of extra space
'count' of space characters

SetTextJustification MSDN-API reference

Example

Print_SetTextJustification(0,0)


Print_SetTextSpacing()

Syntax

Print_SetTextSpacing(l.f)

Description

Sets the intercharacter spacing.
Intercharacter spacing is added to each character,
including break characters, when the system writes a line of text.

'l' extra-space value

SetTextCharacterExtra MSDN-API reference

Example

Print_SetTextSpacing(0)


Print_SetUnits()

Syntax

Print_SetUnits(Unit.l)

Description

Sets the current unit :

#PRINT_POINTS
all coordinates are given in pixel
#PRINT_INCHES
all coordinates are given in inches
#PRINT_MM
all coordinates are given in mm


Print_SetX()

Syntax

Print_SetX(x.f)

Description

Updates the current position to the specified unit.

x
x-coordinate of new current position

Example

Print_SetX(10)


Print_SetXY()

Syntax

Print_SetXY(x.f,y.f)

Description

Updates the current position to the specified unit.

x
x-coordinate of new current position
y
y-coordinate of new current position

MoveToEx MSDN-API reference

Example

Print_SetXY(10,10)


Print_SetY()

Syntax

Print_SetY(y.f)

Description

Updates the current position to the specified unit.

y
y-coordinate of new current position

Example

Print_SetY(10)


Print_StartDoc()

Syntax

Print_StartDoc(Jobname$ [, OutputFileName$ [, Datatype$]])

Description

Notifies the print spooler that a document is to be spooled for printing.

If the function succeeds, the return value identifies the print job.

StartDocPrinter MSDN-API reference


Print_StartPreview()

Syntax

Print_StartPreview(x.l)

Description

Starts a print preview job.

x
width in pixels of the preview images.


Print_StartPrinting()

Syntax

Print_StartPrinting(Jobname$ [, Outfile$])

Description

Starts a print job.

jobname$ ist the name of the printjob.
outfile$ specifies the name of an output file.

If the function succeeds, it returns the print job identifier for the document.

StartDoc MSDN-API reference


Print_StopPreview()

Syntax

Print_StopPreview()

Description

Ends a print preview job.


Print_StopPrinting()

Syntax

Print_StopPrinting()

Description

Ends a print job.

If the function succeeds, the return value is greater than zero.

EndDoc MSDN-API reference


Print_Text()

Syntax

Print_Text(x.f,y.f,Text$)

Description

Writes a character string at the specified location.

x
x-coordinate of starting position
y
y-coordinate of starting position

TextOut MSDN-API reference


Print_TextHeight()

Syntax

Print_TextHeight(Text$)

Description

Gets the height of the specified text.

GetTextExtentPoint32 MSDN-API reference


Print_TextWidth()

Syntax

Print_TextWidth(Text$)

Description

Gets the width of the specified text.

GetTextExtentPoint32 MSDN-API reference


Print_WriteData()

Syntax

Print_WriteData(*Membuffer.l,Size.l)

Description

Writes data to the specified printer.

If the function succeeds, it returns the amount of bytes written.

WritePrinter MSDN-API reference


Print_WriteString()

Syntax

Print_WriteString(String$ [, Mode])

Description

Prints a string to the specified printer.

If the function succeeds, it returns the amount of bytes written.

WritePrinter MSDN-API reference


Print_WriteStringN()

Syntax

Print_WriteStringN(String$ [, Mode])

Description

Prints a string to the specified printer and adds a CRLF to it.

If the function succeeds, it returns the amount of bytes written.

WritePrinter MSDN-API reference


PRINTDLGEX Flags

#PD_ALLPAGES
The default flag that indicates that the All radio button is initially selected.
#PD_COLLATE
If this flag is set, the Collate check box is selected.
#PD_CURRENTPAGE
If this flag is set, the Current Page radio button is selected.
#PD_DISABLEPRINTTOFILE
Disables the Print to File check box.
#PD_ENABLEPRINTTEMPLATE
Indicates that the hInstance and lpPrintTemplateName members specify a replacement
for the default dialog box template in the lower portion of the General page.
#PD_ENABLEPRINTTEMPLATEHANDLE
Indicates that the hInstance member identifies a data block that contains a preloaded dialog box template.
#PD_EXCLUSIONFLAGS
Indicates that the ExclusionFlags member identifies items to be excluded from the printer driver property pages.
#PD_HIDEPRINTTOFILE
Hides the Print to File check box.
#PD_NOCURRENTPAGE
Disables the Current Page radio button.
#PD_NOPAGENUMS
Disables the Pages radio button and the associated edit controls.
#PD_NOSELECTION
Disables the Selection radio button.
#PD_NOWARNING
Prevents the warning message from being displayed when an error occurs.
#PD_PAGENUMS
If this flag is set, the Pages radio button is selected.
#PD_PRINTTOFILE
If this flag is set, the Print to File check box is selected.
#PD_SELECTION
If this flag is set, the Selection radio button is selected.
#PD_USEDEVMODECOPIES
Same as #PD_USEDEVMODECOPIESANDCOLLATE.
#PD_USEDEVMODECOPIESANDCOLLATE
This flag indicates whether your application supports multiple copies and collation.
#PD_USELARGETEMPLATE
Forces the property sheet to use a large template for the General page.

Complete list of flags can be found here :
PRINTDLGEX Structure MSDN-API reference


Printer_Lib library license

This purebasic user library is provided 'as-is', without any express or implied warranty.
In no event will the author be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial
applications, and redistribute it freely.