$OPTIMIZE ON
$APPTYPE GUI
$TYPECHECK ON
$ESCAPECHARS ON
$INCLUDE "printerdll.inc"
DIM form AS QFORM
DIM B1 AS QBUTTON
DIM rtn AS LONG, prt_Handle AS LONG, pdc_Handle AS LONG
DIM bm1 AS QBITMAP
DIM jobID AS LONG
DIM stg$ AS STRING
DIM counter AS LONG
prt_Handle=0
bm1.BMP="john.bmp"
SUB BC1(Sender AS QBUTTON)
jobID=Document_Open("Graphics and Text","","EMF")
IF jobID>0 THEN
rtn=Page_New
IF rtn=1 THEN
Pen_CreateSolid(5,&H00000000)
Draw_Rectangle(50,50,2840,4050)
Pen_DeleteSolid
Draw_Rectangle(500,140,2300,480)
stg$="Arial"
Font_Create(36,16,1,1,FW_BOLD,ITALIC_OFF,UNDERLINE_OFF,STRIKEOUT_OFF,_
DEFAULT_CHARSET,OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY,_
DEFAULT_PITCH OR FF_DONTCARE,stg$)
stg$="Wedding Invitation"
Page_String(650,200,stg$,LEN(stg$))
Font_Delete
stg$="Bookman Old Style"
Font_Create(16,16,1,1,FW_BOLD,ITALIC_OFF,UNDERLINE_ON,STRIKEOUT_OFF,_
DEFAULT_CHARSET,OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY,_
DEFAULT_PITCH OR FF_DONTCARE,stg$)
stg$="Guests"
Page_String(80,800,stg$,LEN(stg$))
stg$="In-Laws"
Page_String(80,1200,stg$,LEN(stg$))
stg$="Best Man"
Page_String(80,1600,stg$,LEN(stg$))
Font_Delete
stg$="Bookman Old Style"
Font_Create(10,10,1,1,FW_NORMAL,ITALIC_OFF,UNDERLINE_OFF,STRIKEOUT_OFF,_
DEFAULT_CHARSET,OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY,_
DEFAULT_PITCH OR FF_DONTCARE,stg$)
stg$="Guest are permitted to get Drunk, provided they be"
Page_String(80,950,stg$,LEN(stg$))
stg$="sick on the mother-in-law."
Page_String(80,1050,stg$,LEN(stg$))
stg$="In-Laws must tolerate any abuse hurled at them."
Page_String(80,1350,stg$,LEN(stg$))
stg$="Turn up on time and don`t forget the Rings."
Page_String(80,1750,stg$,LEN(stg$))
Draw_ResizedBitMap(bm1.Handle,0,0,121,149,80,1850,1210,1490,SRCCOPY)
Font_Delete
rtn=Page_Print
END IF
Document_Close
END IF
END SUB
SUB CleanUp_PrinterDLL
Printer_CloseDefault
END SUB
SUB SetUp_PrinterDLL
rtn=Printer_OpenDefault(5000)
IF rtn=4 THEN
prt_Handle=Printer_GetHandle
Form.SHOWMODAL
ELSEIF rtn=3 THEN
SHOWMESSAGE("Printer Opened and PI2 created - but no DC created")
Printer_CloseDefault
ELSEIF rtn=2 THEN
SHOWMESSAGE("Printer Opened - but no PI2 or DC created")
Printer_CloseDefault
ELSEIF rtn=1 THEN
SHOWMESSAGE("Printer - Failed to start Initialization")
ELSE
SHOWMESSAGE("Printer - Not Opened/Installed?")
END IF
END SUB
Form.Width=180 : Form.Height=72 : Form.Center : Form.CAPTION=" Print A Poster"
Form.OnClose=CleanUp_PrinterDLL
B1.PARENT=Form : B1.CAPTION="Print" : B1.Top=6 : B1.Left=6
B1.Width=140 : B1.Height=30 : B1.OnClick=BC1
SetUp_PrinterDLL
|
|