PrintWizard Tip 01

How do we get from data to printed page?

Step 1 is to install PrintWizard on a PC. It doesn’t really matter which PC in your network has it running because PW will get the data from anywhere. Let’s keep it simple for now and say PW is installed on the same system as the application generating the report.

Step 2 is to get the paths for data and images. I used a text editor to create my data so I have a simple TXT file in one directory, and coincidentally but not required, I put the TIF image for the overlay in the same directory. I also created a little BAT file in the same directory with one line so that I can tell PrintWizard to marry my data and the image, and then pass it through a specific printing profile.

A what? PrintWizard allows us to create lots of profiles so that we can regulate lots of different kinds of print jobs. You can print invoices in one report and orders in the next – and the application generating the data doesn’t need to know where to direct the output. A profile manages printing, sending to PDF, faxing, emailing, or storing a document somewhere for later retrieval. For simplicity I have a PW profile to send output to my default printer, which on my development system here happens to be PDFCreator, a FLOSS utility. PrintWizard can send output to PDF directly but for this one example I’m just not using that feature.

Anyway, here is my BAT file broken into multiple lines just for readability:

"C:\Program Files\Printwiz30\printwiz"
"C:\WinTemp\PrintWizard\testdoc2.txt"
/overlay="C:\WinTemp\PrintWizard\form1.TIF"
/Ppwservice01

The full path to the PW executable is provided, then the filename with the data, then the filename for the overlay image, then the profile name I’m using to put it together. Not tough, eh? So I execute the BAT, it merges data and overlay, and sends output to my "printer", which again happens to be PDF on my system, so I get a PDF that pops up in front of me.

Miscellaneous

Honestly I had to revise the goto statements a bunch of times to get the positioning right – but that’s the game we play all the time with character screens, thick or thin clients, or printed reports.

The beginning of the data has some tags that setup how the data will be rendered:

<PWML> <pagesize orientation="portrait"> <BODY> <PRE> <font color="red">

If you’re familiar with HTML the tags will look a little too familiar. Is PW printing an HTML page? Should we use tables? No and No. The tags are familiar just to keep it easy. There are many unique tags and attributes that manage margins, gutters, and other document formatting that isn’t available in a browser.

Summary

I hope this is a good introduction to PrintWizard through just one of many great features. In the next tip I’ll show you how to change text styles, draw boxes and add images to your printed document. Then (making this up as I go) I’ll show a couple ways to get PW to capture data in unusual ways. Finally, I’ll show you how to use PW to send an email and maybe a FAX.

Why do I like PrintWizard? In three four five ways it’s like the other tools we sell and support here at Nebula R&D – it does a lot more than people might think, it’s stable, affordable, easy to use, and well supported. I like software I can rely on, and I like to share tools like this with colleagues so that we can all make end-users happy. It’s good for everyone.

Please feel free to have a look at our PrintWizard web page, post questions to our forum, and request a download.

Leave a Reply