How do you achieve that? Just do StartPrinting for each pages? I never used the Printer lib before.
Also, is there some kind of print preview available (cross platform)? Just need to check before I start writing my own
...it's Windows only. Of course cross-platform should be do-able, the printers are the same but much depends on what API is provided on the other platforms. It might be worth having a 3-platform solution rather than a cross-platform.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
I use the Printer_Lib for an envelope printing program I wrote. It works well and has a print preview ability.
Printing in Purebasic (and for that matter, most languages) really sucks. Printing under DOS was so easy and straight forward (even graphics were easy) now almost all of your printing is going to have to go through APIs for whatever OS your running, otherwise you will need to write your own assembly Print library based for each processor you want to be able to use. Easier to just use the APIs for the OS.
Please don't take me the wrong way. PureBasic is great. Printing in PureBasic is possible, but it is one of the weaker aspects of using PureBasic. I spend more time on "printing"-layout problems and making "pretty" reports which sell software, then typically the software it self. ( CEOs, CFOs, Human Resource Managers, they all want nice pretty reports on paper either for compliance reasons or because so many of them are still tactile in nature).
The PurePDF lib and the Printer_Lib really do fill in a printing gap in PureBasic and are perfect for Windows only programs. But with PureBasic being touted and presented as a cross-platform language there really should be standardized Printer Library and Functions built-in for quick and easy printing layout. What is that PureBasic has...8 Printer based functions to Open it, start it, stop it, etc. And then everything for layout is the cumbersome 2d Drawing commands?
My background goes way back to Mainframe and DOS days and printing nice reports was usually really simple and very little hassle. Given, there typically was a "report writer" type function in most of the languages where you did the layout with variables and the system would either use that as a template or "generate code" for your printing routines.
PureBasic and most Windows based languages (VB, C++, etc) do not have any such function (although I think VB and Visual Foxpro did have something that made layouts easier, cant remember been toolong since I even tried em). Today's languages are compilers pure and simple and the creators thought process is that any "tools" that are needed should be made by the programmers. Yep, re-create the wheel everytime or make your own include libraries, so to speak. Not too many good RADs or 4G languages out there anymore. Yes, there is Crystal Reports, R&R ReportWriter and other third-party data-centric report writers now to fill the gap. But for the majority of what I do, these solutions are way too expensive for my end users.
Sure I should take it upon myself to write a "report writer" for PureBasic, but I am too busy doing other things that need to be done to make money now. Plus, I am not a "tool writer" so to speak. There are those in this community that are great at that and eventually, one of them may get around to doing it.
Sure I should take it upon myself to write a "report writer" for PureBasic, but I am too busy doing other things that need to be done to make money now. Plus, I am not a "tool writer" so to speak. There are those in this community that are great at that and eventually, one of them may get around to doing it.
I think sRod may have achieved that for Windows with his Arctic Reports. However, his website is currently down: http://www.arctic-reports.com/