home *** CD-ROM | disk | FTP | other *** search
- on printBitmap theCast
- if the castType of cast theCast <> #bitmap then
- alert("PrintBitmap can only print bitmapped castmembers.")
- exit
- end if
- if the machineType = 256 then
- set XObjFile to "pmatic.dll"
- else
- set XObjFile to "BLENDER3:FILES:pmatic.xobj"
- end if
- openXLib(XObjFile)
- set printer to PrintOMatic(mnew)
- if not objectp(printer) then
- alert("There is no currently selected printer. Printing features are disabled.")
- else
- printer(mRegister, "PMAT130-925-01031")
- set pw to printer(mGetPageWidth)
- set ph to printer(mGetPageHeight)
- set w to the width of cast theCast
- set h to the height of cast theCast
- set scaling to min(float(pw) / float(w), float(ph) / float(h))
- if (scaling < 1.0) and (w > h) then
- printer(mSetLandscapeMode, 1)
- set pw to printer(mGetPageWidth)
- set ph to printer(mGetPageHeight)
- set scaling to min(float(pw) / float(w), float(ph) / float(h))
- end if
- set scaling to min(scaling, 1.0)
- set w to integer(w * scaling)
- set h to integer(h * scaling)
- set left to (pw - w) / 2
- set top to (ph - h) / 2
- printer(mNewPage)
- printer(mPicture, the picture of cast theCast, left, top, left + w, top + h)
- if printer(mDoJobSetup) = 1 then
- updateStage()
- printer(mPrint)
- end if
- printer(mdispose)
- end if
- closeXLib(XObjFile)
- end
-
- on min a, b
- if a < b then
- return a
- else
- return b
- end if
- end
-
- on PrintTexta textStringBig, textStringLittle
- if the machineType = 256 then
- set printingFont to "arial"
- set XObjFile to "pmatic.dll"
- else
- set printingFont to "helvetica"
- set XObjFile to "BLENDER3:FILES:pmatic.xobj"
- end if
- openXLib(XObjFile)
- set printer to PrintOMatic(mnew)
- if not objectp(printer) then
- alert("There is no currently selected printer. Printing features are disabled.")
- else
- printer(mRegister, "PMAT130-925-01031")
- printer(mSetMargins, 72, 72, 72, 72)
- set w to printer(mGetPageWidth)
- set h to printer(mGetPageHeight)
- printer(mSetTextFont, printingFont)
- printer(mSetTextSize, 10)
- printer(mSetTextStyle, "normal")
- printer(mNewPage)
- printer(mTextBox, 0, 0, w, h, 0)
- printer(mSetText, textStringBig, 1)
- printer(mSetTextSize, 7)
- printer(mAppendText, textStringLittle, 1)
- if printer(mDoJobSetup) = 1 then
- updateStage()
- if the optionDown then
- printer(mPrintPreview)
- else
- printer(mPrint)
- end if
- end if
- printer(mdispose)
- end if
- closeXLib(XObjFile)
- end
-
- on printText textString
- if the machineType = 256 then
- set printingFont to "arial"
- set XObjFile to "pmatic.dll"
- else
- set printingFont to "helvetica"
- set XObjFile to "BLENDER3:FILES:pmatic.xobj"
- end if
- openXLib(XObjFile)
- set printer to PrintOMatic(mnew)
- if not objectp(printer) then
- alert("There is no currently selected printer. Printing features are disabled.")
- else
- printer(mRegister, "PMAT130-925-01031")
- printer(mSetMargins, 72, 72, 72, 72)
- set w to printer(mGetPageWidth)
- set h to printer(mGetPageHeight)
- printer(mSetTextFont, printingFont)
- printer(mSetTextSize, 10)
- printer(mSetTextStyle, "normal")
- printer(mNewPage)
- printer(mTextBox, 0, 0, w, h, 0)
- printer(mSetText, textString, 1)
- if printer(mDoJobSetup) = 1 then
- updateStage()
- printer(mPrint)
- end if
- printer(mdispose)
- end if
- closeXLib(XObjFile)
- end
-