Page 1 of 1

Printer settings through Carbon API

Posted: Fri Jun 24, 2011 6:25 pm
by coder14
PureBasic has some great printer functions, but unfortunately some of the basic ones are missing. Is there any way I can use API calls to programatically get/set resolution, paper size, orientation and also the number of copies to print?

Is there anything similar to the WinAPI EnumDisplaySettings/ChangeDisplaySettings, where we can use the DEVMODE structure to initialize the settings?

Re: Printer settings through Carbon API

Posted: Sun Jun 26, 2011 8:49 pm
by jesperbrannmark
I think the only safe way to do a print is to generate a HTML or PDF file and then open that on screen and let the user print.
Both can be done with the excellent Applescript wrapper!

Re: Printer settings through Carbon API

Posted: Mon Jun 27, 2011 4:16 am
by coder14
jesperbrannmark wrote:I think the only safe way to do a print is to generate a HTML or PDF file and then open that on screen and let the user print.
Both can be done with the excellent Applescript wrapper!
You don't really need to do that - PB already has a set of good built-in functions to do WYSIWYG printing. But how can I control settings like orientation and number of copies, to print directly to the default printer without the PrintRequester?

Re: Printer settings through Carbon API

Posted: Mon Jun 27, 2011 4:27 am
by WilliamL
PB already has a set of good built-in functions...
Not for the Mac. All printing is done from an image as I pointed out in my 'Programming on the Mac platform' thread. http://www.purebasic.fr/english/viewtop ... 19&t=45613

Re: Printer settings through Carbon API

Posted: Fri Jul 01, 2011 9:29 am
by coder14
WilliamL wrote:
PB already has a set of good built-in functions...
Not for the Mac. All printing is done from an image as I pointed out in my 'Programming on the Mac platform' thread. http://www.purebasic.fr/english/viewtop ... 19&t=45613
Whoa! You're right - the rendering for both text and graphics is really blurry and pixelated. I can't seem to find any way around this. Does anyone have any idea how to call the Carbon functions (PMCreateSession, PMBeginDocument, etc) from within PB? It seems complicated - is it even possible?