It is currently Sun May 19, 2013 12:10 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 12 posts ] 
Author Message
 Post subject: Print several pages
PostPosted: Mon Feb 06, 2012 10:41 pm 
Offline
Addict
Addict

Joined: Tue May 06, 2003 5:07 pm
Posts: 2257
Location: UK
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 :)


Top
 Profile  
 
 Post subject: Re: Print several pages
PostPosted: Mon Feb 06, 2012 11:36 pm 
Offline
Addict
Addict

Joined: Fri Oct 23, 2009 2:33 am
Posts: 2852
Location: Wales, UK
Take a look at Printer_Lib: http://www.purebasicpower.de/?PrinterLib

_________________
IdeasVacuum
If it sounds simple, you have not grasped the complexity.


Top
 Profile  
 
 Post subject: Re: Print several pages
PostPosted: Tue Feb 07, 2012 12:04 am 
Offline
Addict
Addict

Joined: Tue May 06, 2003 5:07 pm
Posts: 2257
Location: UK
Thanks but it doesn't look cross platform as the code is not provided ;)


Top
 Profile  
 
 Post subject: Re: Print several pages
PostPosted: Tue Feb 07, 2012 1:14 am 
Offline
Addict
Addict

Joined: Fri Oct 23, 2009 2:33 am
Posts: 2852
Location: Wales, UK
...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.


Top
 Profile  
 
 Post subject: Re: Print several pages
PostPosted: Wed Feb 08, 2012 11:39 pm 
Offline
User
User
User avatar

Joined: Wed Jun 27, 2007 10:10 pm
Posts: 58
Location: USA
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.

Slyvnr


Top
 Profile  
 
 Post subject: Re: Print several pages
PostPosted: Wed Feb 08, 2012 11:50 pm 
Offline
Addict
Addict

Joined: Tue May 06, 2003 5:07 pm
Posts: 2257
Location: UK
Slyvnr wrote:
Printing in Purebasic (and for that matter, most languages) really sucks.

Why so? What does PB's lib lacks?


Top
 Profile  
 
 Post subject: Re: Print several pages
PostPosted: Thu Feb 09, 2012 12:16 am 
Offline
Addict
Addict

Joined: Fri Oct 23, 2009 2:33 am
Posts: 2852
Location: Wales, UK
...just take a look at Printer_Lib and you will see the difference :)

_________________
IdeasVacuum
If it sounds simple, you have not grasped the complexity.


Top
 Profile  
 
 Post subject: Re: Print several pages
PostPosted: Thu Feb 09, 2012 12:46 am 
Offline
User
User
User avatar

Joined: Wed Jun 27, 2007 10:10 pm
Posts: 58
Location: USA
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.

Slyvnr


Top
 Profile  
 
 Post subject: Re: Print several pages
PostPosted: Thu Feb 09, 2012 12:56 am 
Offline
Addict
Addict

Joined: Fri Oct 23, 2009 2:33 am
Posts: 2852
Location: Wales, UK
Quote:
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/

You are right about how useful the PurePdf lib is too, it is brilliant: http://www.purebasicpower.de/?PurePDF

_________________
IdeasVacuum
If it sounds simple, you have not grasped the complexity.


Top
 Profile  
 
 Post subject: Re: Print several pages
PostPosted: Thu Feb 09, 2012 11:45 pm 
Offline
Addict
Addict

Joined: Tue May 06, 2003 5:07 pm
Posts: 2257
Location: UK
Well, how do I print several pages with PB's internal function?


Top
 Profile  
 
 Post subject: Re: Print several pages
PostPosted: Fri Feb 10, 2012 12:26 am 
Offline
Addict
Addict

Joined: Fri Oct 23, 2009 2:33 am
Posts: 2852
Location: Wales, UK
By using the NewPrinterPage() function. Code snippet in PB Help:
Code:
If PrintRequester()
    If StartPrinting("Two sheets")
      If StartDrawing(PrinterOutput())
        DrawingMode(#PB_2DDrawing_Transparent)
        DrawText(10, 10, "First page !", RGB(0, 0, 0))
     
        ; ---> Tell the printer to start a new page <----
        NewPrinterPage()
       
        DrawText(10, 10, "Second page !", RGB(0, 0, 0))
     
        StopDrawing()
      EndIf
     
      StopPrinting()
    EndIf
  EndIf

_________________
IdeasVacuum
If it sounds simple, you have not grasped the complexity.


Top
 Profile  
 
 Post subject: Re: Print several pages
PostPosted: Fri Feb 10, 2012 4:48 pm 
Offline
Addict
Addict

Joined: Tue May 06, 2003 5:07 pm
Posts: 2257
Location: UK
Cheers mate, cant believe I overlooked that! :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: Joris and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye