Zappo Printing DLL for DarkBasic Pro V.0.0.2
============================================

Description:
------------
There have been lots of calls for a DarkBasic Pro plugin which will
allow printing. Well, here is one which is as simple as I could
possibly make it to use.
It is currently still a Beta version. The error checking needs work
but I have tested it with monochrome laser printers, colour inkjets
and PDF creators with complete success!

Installation:
-------------
Copy the 'ZappoPrint.dll' file to the 'plugins-user' folder of
your DarkBasic Pro installation, usually something like:
C:\Program Files\Dark Basic Professional\Compiler\plugins-user

Copy the 'keywords_zappoprinting.ini' file to the 'keywords'
folder of the DarkBasic Pro Editor directory, usually like:
C:\Program Files\Dark Basic Professional\Editor\Keywords

Run or restart your DarkBasic Pro IDE and give it a try!

Usage:
------
There are four functions, the first of which is optional. It
takes the form:
   Zappo PrintDialog()
This will call up the Windows Printer Dialog box to allow users
to choose which printer they want to use (if they have more than
one installed) and the usual things like papersize, print quality
etc). It returns TRUE if the user clicks on the 'okay' button or
FALSE if they click on the 'cancel' button. The result is not
used by the plugin but is there in case you want it.
A quick example would be:

if Zappo PrintDialog()
   print "Clicked OKAY"
else
   print "Clicked CANCEL"
endif

The second function is to actually print something. It will only
print a bitmap so its up to you to decide what you will print.
A good example would be to capture the screen and save it as a
bitmap. It takes the following form:
   Zappo PrintOut(filename, orientation, scale)
This will print the bitmap called 'filename'. It must be in
bitmap format - not Jpeg, Png, or anything else. If there is a
call for other format I may add them later.
The 'orientation' flag should be 0 to use the current printers
orientation (which can also be set from the dialog box by the
user), 1 for portrait or 2 for landscape.
The 'scale' flag will resize the image to fill the page but keep
the aspect ratio. Using 0 will not scale the image (i.e. print
it as it comes at the printers resolution), while a 1 will scale
the image. It returns TRUE if the image was loaded and sent to
the print queue successfully (its up to Windows from then on) or
FALSE if there is problem (usually because it cannot load the
image).
A quick example would be:

if Zappo Printout("mypicture.bmp",0,1)
   print "Sent To Printer"
else
   print "Problem with Image"
endif

The third and forth new functions are to return the current
width and height of the printer page. This will depend upon the
paper selected in the printer and the resolution it is set to
print at.
   Zappo PageWidth()
   Zappo PageHeight()
They both return an Integer value which the number of dots or
pixels possible on the page. This means you can create a bitmap
the exact size of the printable page so printing comes out at
the highest possible quality.

Usage Restrictions:
-------------------
You may use this DLL within your DarkBasic Pro creations for
commercial and noncommercial purposes. I would appreciate a
mention in the credits, but it is not essential. All I do ask is
that you let me know if you release anything which uses it.

The DLL remains copyright to me (Neil King) and you must not pass
it off as your own work. You may not sell this DLL or distribute
it without my authorisation. I hope you find it useful. I will
not be held responsible for any ill effects from this DLL. Use it
at your own risk.
Contact: darkbasic@contactking.com