Printing Support

Previous topic - Next topic

TI-994A

Hello everyone. I would like to post a GLB-newbie question, if I may. The issue has been raised in this forum over the past few years, but with no definitive answer. So, my question is, does GLBasic support printer output at all? Or, are there any plans to implement this feature?

It seems that this one single feature is the only hindrance to making GLBasic an all-round programming tool; not just for games.

Your feedback will be really appreciated.

Thank you.
Texas Instruments TI-99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too!

Moru

If I want to print something, I load up open office or some other tool made for printing. I don't expect a coding-tool to do any sort of (useful) printing... :-)

TI-994A

Quote from: Moru on 2011-Jun-08
If I want to print something, I load up open office or some other tool made for printing. I don't expect a coding-tool to do any sort of (useful) printing... :-)
Thanks for the quick reply; but please let me clarify.

I'm not referring to the IDE, but rather the programmability of printing functions, such as commercial applications printing out invoices, accounts, etc. GLBasic already has very powerful graphics output capabilities to the screen display. All that would be required is to transfer this same output, if not directly to the printer, at least to the OS Print Spooler/Manager.

Even if this may not be viable for the handheld platforms, it should be included for the desktop versions.
Texas Instruments TI-99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too!

Moru

Oh yes, this I would like too. One thing I can see against it is that GLBasic is supposed to be multi-platform, what works on one platform we as users expect to work on all platforms.

matchy

I suppose printing support can extend to EPS or PDF files which can then be spooled on any platform, so there are probably libraries available to import/wrap.

spicypixel

Quote from: matchy on 2011-Jun-08
I suppose printing support can extend to EPS or PDF files which can then be spooled on any platform, so there are probably libraries available to import/wrap.

And how indeed would you access the saved pdf on an iPhone for example?
http://www.spicypixel.net | http://www.facebook.com/SpicyPixel.NET

Comps Owned - ZX.81, ZX.48K, ZX.128K+2, Vic20, C64, Atari-ST, A500.600.1200, PC, Apple Mini-Mac.

TI-994A

#6
Quote from: Moru on 2011-Jun-08
Oh yes, this I would like too. One thing I can see against it is that GLBasic is supposed to be multi-platform, what works on one platform we as users expect to work on all platforms.
Cross-platform support is great, I don't deny that, but considering the hardware disparity between these platforms, an implementation of some platform-dependent commands should be acceptable. True cross-platform portability need not entail 100% line for line duplication; the differences in screen sizes between desktop and handhelds already require quite a bit of modification to the code, but the core structure is still portable.

As for printing, PureBasic supports Win32/64 and iOS, as well as Linux, with a set of versatile true cross-platform functions.

Why not GLBasic.
Texas Instruments TI-99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too!

MrTAToad

Would depend on who really needs it - would it actually be worth Gernot spending time on ?

TI-994A

Quote from: MrTAToad on 2011-Jun-08
Would depend on who really needs it - would it actually be worth Gernot spending time on ?
There are a considerable number of VB coders out there getting fed-up with the dot-net luggage. Couple this with the demand for iPhone/iPad/iPod apps, GLBasic has got a niche in this market. But if it is seen only as a gaming platform, these defectors will shop around for the likes of PureBasic and NSBasic to fill their needs.

Currently PureBasic only supports desktop platforms, and NSBasic/AppStudio is standalone and doesn't compile to an iPhone native app using XCode, but rather only to a web app using the third party tool PhoneGap. They may all be BASIC in syntax, but the differences in the program structure and logic can be dauntingly different.

GLBasic, with its cross-platform portability, has the potential to corner this niche developer market. Pretty worthwhile.
Texas Instruments TI-99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too!

MrTAToad

But only if printing commands are used - especially as it would be extremely tricky for mobile applications.  I believe only Windows CE has native support for that.

Kitty Hello

There's 2 very easy ways to do it.

1st: Write a temp HTML file with optional PNG images and call a webbrowser to print it (OK, you must make that platform specific, but only 3 platforms, right?)

2nd: Write an RTF file (a bit harder but gives very accurate control of everything. It's a WORD doc in ASCII so to say. Use Wordpad to get started with the format.

Slydog

Or, if you don't like easy, I have a hard way to do it!
Wrap GLB functions around the Win32 printing API calls.
Here's two links from a Google search:

How To Send Raw Data to a Printer Using the Win32 API from Visual Basic
http://support.microsoft.com/kb/154078

Win32 API and Printers: Print Directly to a Printer
http://www.thedbcommunity.com/index.php?option=com_content&task=view&id=226&Itemid=44

You'd have to convert the examples to GLB and/or INLINE C.
But, this would give you full printing control (Windows only of course) without any limitations.
My current project (WIP) :: TwistedMaze <<  [Updated: 2015-11-25]

matchy

Generally, I really get annoyed when the first post is an impression on a "how to" but turns in to a marketing and political argument about the pros and cons of GLB because suggestions are not satisfactory or trigger cause for debate.  :rant:

Quote from: spicypixel on 2011-Jun-08
And how indeed would you access the saved pdf on an iPhone for example?
Is that a trick question?  O_O Just load any file from where it was saved, i.e. the documents folder which has read/write access.

spicypixel

#13
Quote from: matchy on 2011-Jun-09
Quote from: spicypixel on 2011-Jun-08
And how indeed would you access the saved pdf on an iPhone for example?
Is that a trick question?  O_O Just load any file from where it was saved, i.e. the documents folder which has read/write access.

No I meant you can indeed access the Documents folder to the PDF file within GLB for read/write access but you can't access the PDF to transfer it to a PC for printing without 3rd party software can you? Ideally to work on all devices/PC's it would be best to save as a HTML file which can easily be output with formatting control from GLB and if it's a desktop machine simply save it, and if it's a mobile device send it wirelessly to a connected desktop PC. This allows printing effectively from any device so long as it has connectivity.
http://www.spicypixel.net | http://www.facebook.com/SpicyPixel.NET

Comps Owned - ZX.81, ZX.48K, ZX.128K+2, Vic20, C64, Atari-ST, A500.600.1200, PC, Apple Mini-Mac.

Kitty Hello

You can enable document sharing for your app in XCode. When you plug into iTunes then, you can drag/drop documents from/to the app's documents directory. I have not done that myself, but I'm quite sure it works.