vlaentina printomatic

Information Team info at castus.com
Tue Jan 15 06:41:17 CST 2008


Not sure if I am on the right tract  trying to print slide presentation which is an SWF file,

calling on database to load the current file running which is same as me.pubDisplayPage()

So now I am trying to figure out how to print each screen rather than the same screen over and over.



Any help for this newbie appreciated





on pubPrintAllPage me 


-- Get a reference to the current MIAW and create a bitmap of it

objWin = me.currentDisplayWindow

objWin.type = #document

objWin.moveToFront()


imgWin = objWin.image

bmp = new(#bitmap)

bmp.image = imgWin


-- Export the bitmap

--objExport = new(xtra "SharpExport")

--objExport.exportJPG(bmp, the moviePath & "print.jpg", 100)


-- Kill the Xtra and erase the member

--objExport = void


-- Print the file

--baPrintFile(the moviePath & "print.jpg")

--Set Instance


doc = new(xtra "PrintOMatic")

-- testing if something has going wrong here

if not objectP(doc) then


-- if so ... a) alert

alert ("Sorry - could'n make an instance of PrintOMatic here!")


-- simple exit this function/procedure via returning a zero

return 0


end if


setLandscapeMode(doc, true)

append(doc, bmp)


-- setting the document name

setDocumentName(doc, "Printing Report")



--- This was showing Multple page in print screen and was showing the amount of slides yet printed same slide,

-- repeat with i = 1 to me.eventsList.count

-- if me.intPage + 1 > me.eventsList.count then

-- return 0 


-- end if


-- me.intPage = me.intPage + 1

-- 

-- return 1



set me.event_display = objTable.GetField("me.eventsList.count" , "eID") 

repeat with i = 1 to me.eventsList.count 

me.event_display = new(script "event_display")

me.event_display.e_id = eID

me.event_display.e_name = objTable.GetField("Name")

me.event_display.e_comment = objTable.GetField("Comments")

me.event_display.e_tid = objTable.GetField("TemplateID")

me.event_display.e_tfile = objTable.GetField("FileName")

me.event_display.e_populate(objTable)


me.eventsList.add(objEvent)





-- first page .. 

newPage(doc)






-- place a page number at the bottom right of the page


--set pgNumSym = numToChar(166) -- paragraph symbol on mac


--setPageNumSymbol(doc, pgNumSym)


--setTextJust(doc, "right")


--drawText(doc, Point(getPageWidth(doc),getPageHeight(doc)), "page"&&pgNumSym)


set stageWidth = the width of the rect of the stage

set stageHeight = the height of the rect of the stage


set pageWidth = getPageWidth(doc)

set pageHeight = getPageHeight(doc)


set scaling = min(1.0,float(pageWidth)/float(stageWidth))

set scaling = min(scaling,float(pageHeight)/float(stageHeight))


set destWidth = integer(scaling*stageWidth)

set destHeight = integer(scaling*stageHeight)


-- figure top left starting point for a centered image

set destLeft = (pageWidth-destWidth)/2

set destTop = (pageHeight-destHeight)/2

drawStagePicture(doc, Rect(destLeft,destTop,destLeft+destWidth,destTop+destHeight), Rect(0,0,stageWidth, stageHeight), True) 

 append(doc, me.event_display, FALSE)


objTable.NextRecord()






end repeat






if the controlDown then



printPreview(doc)


else


if doJobSetup(doc) then


print()




end if

end if

bmp.erase()


set print = 0


-- Redisplay the page

me.pubDisplayPage()

--me.currentDisplayWindow = #tool

me.currentDisplayWindow.type = #document


end

end


More information about the Valentina mailing list