Page 1 of 1
Getting and setting printer settings without dialogs?
Posted: Tue Sep 30, 2008 11:58 pm
by Garrett
Ok, now you all have opened a can of worms for me here.. Whoooooole new world opened up for me!
I'm starting to catch on to the printing stuff, like making sure you adjust your printable area to compensate for the margin sizes set for the print job.
But! Now I'm trying to find out how to find out what the margin sizes are set for the printer, and how to set them from my own code without user intervention prior to printing.
I found the "printerSettings" property, is that what I'll be using? If so, is anyone willing to give me some more details on this property than what the docs in 2.9 are giving me?
Thanks in advance,
~Garrett
Posted: Wed Oct 01, 2008 6:11 am
by Janschenkel
Hi Garrett,
The 'printerSettings' property is a raw environment-dependent binary string: it describes the settings of the user-selected printer on a single computer in a way that you can't parse, just 'get' and 'set'. So that's useful for those situations where you want to ask the user for his settings once and save that somewhere to restore it every time your application starts.
You're looking for the 'printerFeatures', 'printMargins', 'printPaperScale', 'printRotated' and similar global properties. The easiest way is to open the Rev dictionary, choose 'All' in the left-hand list and then type 'print' into the search filter field.
Also, you can find a few examples in the Revolution Resource Center inside the IDE: in the left-hand list, fold out the 'Sample Scripts' entry: it should contain 3 examples for printing.
Last but not least, the User Guide contains a comprehensive chapter on Revolution's printing features - see chapter 9, starting on page 286.
Hope this gets you started - printing in Revolution is not that complicated and in fact very flexible but it takes some getting used to the finer points, such as 'formatForPrinting' on Windows.
Jan Schenkel.
Posted: Wed Oct 01, 2008 9:41 am
by Garrett
Sweet, thanks for the info.
I did type "print" in the search box, but didn't see the printMargin one.. maybe my old eyes just over looked it.
Thanks again,
~Garrett
Posted: Wed Oct 01, 2008 10:34 am
by SparkOut
If you're using 2.9 there's quite a good video tutorial on Layout Printing which should help you grasp some of the concepts, as well as the user guide.
If you open the documentation with the toolbar icon (ie, not the user guide) and pick the "getting started" flag, then the "in depth" box on the bottom right, you will be able to pick from various tutorials. Layout printing is the last one on the list. Hope that helps.
(Aside: Rev 3.0 has some nice tutorial material too, but I can't find how to get to view some of these "older" tutorials - the layout printing one for example is very useful, so why can't I find it in v. 3.0?)