Right now I'm writing the printing routine and it does what I want. But ones in a while I'll have to wait a minute or more before the print start.
The program had delivered the print job to print spooler and and does not hang.
But i'm thinking i'm not using printer related commands correctly.
Anyone who can advise me to optimize the way print commands are used?
Code: Select all
rem Sample code from fabric.bbc
rem Print rectangles and text using sys
rem Canon MF8200C Series UFRII LT
rem Formatting because of dyslextic issues
mode 22
Titel$ = "Projekt: Upside-down"
Titel_xp% = 10
Titel_yp% = 10
Total_members% = 10
Member% = 1
Total_objects% = 10
scale% = 2
Object% = 1
dim Item_{(Total_objects%, Total_members%) Name$, Xpos%, Ypos%, Length%, Height%}
restore (info)
repeat
read Item_{(Object%, Member%)}.Name$
read Item_{(Object%, Member%)}.Xpos%
read Item_{(Object%, Member%)}.Ypos%
read Item_{(Object%, Member%)}.Length%
read Item_{(Object%, Member%)}.Height%
Member% += 1
until Member% > Total_members%
rem name, xpos, ypos, lenght, height
(info)
data "Sheet a", 0, 0, 200, 300
data "Sheet b", 666, 300, 300, 800
data "Sheet c", 1444, 200, 200, 300
data "Sheet d", 1800, 500, 400, 800
data "Sheet e", 2145, 100, 800, 300
data "Sheet f", 0, 700, 500, 800
data "Sheet g", 1000, 1200, 100, 300
data "Sheet h", 2300, 1100, 600, 800
data "Sheet i", 100, 1700, 800, 300
data "Sheet j", 1200, 2000, 1600, 100
proc_landscape
Left_margin% = @vdu%!232
Bottom_margin% = @vdu%!244
Right_margin% = @vdu%!236
Top_margin% = @vdu%!240
*OUTPUT 15
*PRINTERFONT Courier New,8
*MARGINS
vdu 2,32
rem rectangel coordinate corners:
rem x1%,y2% x2%,y2%
rem
rem x1%,y1% x2%,y1%
for Member% = 1 to Total_members%
x1% = Left_margin% + Item_{(Object%, Member%)}.Xpos% * scale%
y1% = Bottom_margin% - Top_margin% - Item_{(Object%, Member%)}.Ypos% * scale%
x2% = x1% + Item_{(Object%, Member%)}.Length% * scale%
y2% = y1% - Item_{(Object%, Member%)}.Height% * scale%
Label$ = Item_{(Object%, Member%)}.Name$
sys "MoveToEx", @prthdc%, x1%, y1%, 0
sys "TextOut", @prthdc%, x1%, y1%, Label$, len(Label$)
sys "LineTo", @prthdc%, x1%, y2%
sys "LineTo", @prthdc%, x2%, y2%
sys "LineTo", @prthdc%, x2%, y1%
sys "LineTo", @prthdc%, x1%, y1%
next
sys "TextOut", @prthdc%, Titel_xp%, Titel_yp%, Titel$, len(Titel$)
*OUTPUT 0
vdu 3, 12
quit
rem from manual
def proc_landscape
local psd%, dm%
dim psd% local 83
!psd% = 84
psd%!16 = 1024
sys "PageSetupDlg", psd%
sys "GlobalLock", psd%!8 to dm%
dm%!40 = 1
dm%?44 = 2
sys "ResetDC", @prthdc%, dm%
sys "GlobalUnlock", psd%!8
sys "GlobalFree", psd%!8
sys "GlobalFree", psd%!12
*MARGINS 10,10,10,10
endproc