Accessing a printer

For general discussion related FlowStone
Post Reply
AnthonyTower
Posts: 29
Joined: Wed Sep 01, 2010 3:22 am

Accessing a printer

Post by AnthonyTower »

Hello all,

In the course of studying FlowStone, I was not capable of finding any support for printing.

Example: Your finished compiled exe has a button in the GUI allowing the user to print on a connected printer the results of an FFT graph and an array of values with some predefined report style page layout (designed at the time the FlowStone schematic was created).

I'm I missing something obvious?

Cheers
DSP
Posts: 150
Joined: Fri May 14, 2010 10:55 pm

Re: Accessing a printer

Post by DSP »

If you want to print you have to do it yourself as you need to decide what to print how big it is etc.

One easy way is to create an off-screen bitmap (Bitmap Create) and then save this to a bitmap file (Bitmap Save). You can then print it from there. This works by making a new off screen bitmap of the view connected to the Bitmap Create Module.

I'm sure you can also do it using Ruby, but that might be a bit more work!
Attachments
BitmapSave.fsm
(796.83 KiB) Downloaded 1170 times
AnthonyTower
Posts: 29
Joined: Wed Sep 01, 2010 3:22 am

Re: Accessing a printer

Post by AnthonyTower »

Vielen dank DSP for the quick and informative response!

An off-screen bitmap, I hadn't thought of that. :o

Where did you find the BitmapSave.fsm DSP ?

Using Ruby I'm guessing I would then just have to add a Ruby component that includes the following function:
system("lpr", filename)
where filename is the name of the off-screen created bitmap.

Once I've leaned FlowStone in greater detail, I will look into using Ruby within FlowStone, but I'm not there yet...

It would be nice, and I'm sure not to difficult to code, a new FlowStone primitive aptly called Print with just two inputs, one that would receive the bitmap, the second a Boolean input that when goes true makes this primitive call-up the Windows Print Dialog and let the printer's drivers take it from there.

Cheers
Post Reply