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?
Printer settings through Carbon API
-
jesperbrannmark
- Enthusiast

- Posts: 536
- Joined: Mon Feb 16, 2009 10:42 am
- Location: sweden
- Contact:
Re: Printer settings through Carbon API
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!
Both can be done with the excellent Applescript wrapper!
Re: Printer settings through Carbon API
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?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!
Re: Printer settings through Carbon API
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=45613PB already has a set of good built-in functions...
MacBook Pro-M1 (2021), Tahoe 26.2, PB 6.30b6
Re: Printer settings through Carbon API
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?WilliamL wrote: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=45613PB already has a set of good built-in functions...
