Am Donnerstag, den 04.02.2010, 09:48 +0100 schrieb Doriano Blengino: > Charlie Reinl ha scritto: > > Salut, > > > > I still haven't solved the Draw.Text tab problem, but I'v a new one (a > > problem). > > > > If you open the printer-setup the first time, the 'Print to printer' is > > chosen, and the target-file behind 'Print to file' is empty. > > > > If you check 'Print to file' and fill the target-file and then you > > switch back to 'Print to printer', the target-file field is disabled. > > (Setup Printer.png) > > > > Everything seems to be alright. > > > > But, and there is my new problem, in my code I can't see what should be > > done. (printing 5 times to file, makes no sense) > > > > Where is the magic pointer, which shows me the chosen device? > > (Printer Properties.png) > > > For what I know about printing in gambas, things are as following. > > You can set by code printer.file to print to a file (a postscript is > generated), or set printer.name to direct the printing to an actual > printer. If printer.file is non-empty, the printing will go to a file. > The same is true if those properties are set by the interactive setup > panel. After that, you don't have to worry about the destination, the > code is the same: you draw() on the printer, and the underlying software > will do what is appropriate. > > Other properties let you to define other printing aspects, like page > format, b/w or color, and so on. > > The properties Copies, FromPage and ToPage are different, because they > don't do anything - you should read them and do things accordingly. To > be more precise, FromPage and ToPage are exactly so (if you read that > the user has set FromPage=2 and ToPage=2, then your printing routine > should only print the page number 2, and then terminate). "Copies" > sometimes works, sometimes not, so I decided to read the number of > copies, reset it to 1, and print several copies myself. I mean: "Copies" > was sometimes working, sometimes was ignored, and sometimes messed up > the printing. If you choose to do multiple copies by code, don't forget > to reset Copies to 1. > > About printing several copies to a file, I see nothing strange... a > postscript file should be generated, containing two or more identical > pages. If you feed that file to a printer, multiple identical pages get > out. But in the first attempt, I did it differently, and I crashed into > rewriting the same file several times, as you are arguing. Can't > remember if it was my fault or gambas or qt one. I solved all together > by invoking multiple times the subroutine which prints a single page, > inside a "draw.begin()" and "draw.end()".
Salut Doriano, letting a part the tab-Problem, the printer problem is not the existing properties of the gambas2-printer. The problem is you have no information about the output device, after printer.setup(). With a bit of luck, the target-file (printer.file) is empty, so it is sure the device is a printer (checked "Print to file" with an empty target-file, disables the OK-Button ). Knowing the output device is important for "Copies", because printing the same "output" x-times to the same file makes no sense. So I repeat my question, where/how can I see/test the output device, after printer.setup. By that way, if somebody can tell me, how/where "Print first page first" and "Print last page first" can be read out, and/or what is to do, for make it working. -- Amicalement Charlie ------------------------------------------------------------------------------ The Planet: dedicated and managed hosting, cloud storage, colocation Stay online with enterprise data centers and the best network in the business Choose flexible plans and management services without long-term contracts Personal 24x7 support from experience hosting pros just a phone call away. http://p.sf.net/sfu/theplanet-com _______________________________________________ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user