Every so often I wonder why I have two output methods in my app
One draws to a printer graphics context, and as such has to worry about the shape of the page that the user chooses or defaults to.
The other uses graphics primitives and DynaPDFMBS to generate a high-quality PDF file.
That , the user chooses the page size and layout.
I can use handy tools such as DynaPDFTable which arent available to the ‘printing’ output
So I wonder: given the PDF output is much better, why dont I just ‘generate a PDF’ all the time, and just print that?
3 answers:
I don’t know how to silently send my PDF to the printer (or whether I should even try!)
I don’t know what would happen if someone chose A3 landscape and the printer was expecting A4 Portrait
Some requirements are for an exact size printout - if I have the printer graphics and the dpi, I can work on that, but a PDF could easily stretch on the way to the page.
Some code provided by MBS:
// select a PDF
dim f as FolderItem = GetOpenFolderItem("")
if f = nil then Return
// open PDF
dim doc as new PDFDocumentMBS(f)
// define some print setting via PrintInfo
dim PrintInfo as new NSPrintInfoMBS
// start print operation
dim printOperation as NSPrintOperationMBS = doc.PrintOperation(printinfo)
printOperation.showsPrintPanel = true
printOperation.showsProgressPanel = true
call printOperation.runOperation
But given the use of NSPrintInfoMBS, this is pretty clearly only for Mac.
Anyone done this on windows?