I've copied my printing script below. For the most part it works fine, however during some times it prints a blank page first and then the contents of my pages afterwards. This is infrequent, but I am wondering why its occurring. Can someone help me with any pointers please?
Code: Select all
global gPageOrientation, gMarginLeft, gMarginTop, gMarginRight, gMarginBottom
on mouseUp
lock screen
put the number of this card into tStartCard
put "Portrait" into gPageOrientation
set the printPaperOrientation to gPageOrientation
put printPaperSize into tPageSize
set itemdelimiter to comma
if gPageOrientation is "Portrait" then
put item 1 of tPageSize into tPageWidth
put item 2 of tPageSize into tPageHeight
else
put item 1 of tPageSize into tPageHeight
put item 2 of tPageSize into tPageWidth
end if
open printing with dialog
set the printMargins to 0,0,0,0
if the result is "Cancel" then exit mouseUp
go to stack "Print"
put the number of cards of stack "Print" into tTotalPages
put 1 into tPageNo
repeat until tPageNo > tTotalPages
go to card tPageNo
put the short name of this cd into tCardName
put "Grp_" & tCardName into tGroupName
hide graphic "margin"
put the vScrollbar of group tGroupName into tVScrollTF
put the hScrollbar of group tGroupName into tHScrollTF
if tVScrollTF is true then
put the formattedHeight of group tGroupName into tGrpHeight
put the vScroll of grp tGroupName into tVScrollPos
set the height of group tGroupName to tGrpHeight
set the top of group tGroupName to 0
end if
if tHScrollTF is true then
put the formattedWidth of group tGroupName into tGrpWidth
put the hScroll of grp tGroupName into tHScrollPos
set the width of group tGroupName to tGrpWidth
set the left of group tGroupName to 0
end if
set the vScrollbar of group tGroupName to false
set the hScrollbar of group tGroupName to false
print card tPageNo from 1,55 to (tPageWidth - 1) , (tPageHeight + 54)
add 1 to tPageNo
show graphic "margin"
set the rect of grp tGroupName to the rect of this cd
set the vScrollbar of group tGroupName to (the formattedHeight of group tGroupName > the height of group tGroupName )
set the hScrollbar of group tGroupName to (the formattedWidth of group tGroupName > the width of group tGroupName )
if tVScrollTF is true then
set the vScroll of grp tGroupName to tVScrollPos
end if
if tHScrollTF is true then
set the hScroll of grp tGroupName to tHScrollPos
end if
end repeat
close printing -- sends job to printer
go to card tStartCard
unlock screen
end mouseUp