[Gambas-user] printer problem

Doriano Blengino doriano.blengino at ...1909...
Fri Feb 5 17:06:58 CET 2010


Charlie Reinl ha scritto:
>
>>> So I repeat my question, where/how can I see/test the output device,
>>> after printer.setup.
>>>   
>>>       
>> Printer.name.
>> This name identifies a CUPS device, and has little to do with the 
>> physical device.
>>
>>
>>     
> Salut,
>
> about Printer.Setup()
>
> It is easily possible to leave Printer.Setup() with the Printer.Name and
> the Printer.file filled (see attached Printer Properties.png)
>
> This happened, while jumping between, "Print to printer" and "Print to
> file" or simply when your Printer object is called several times with
> different targets.
>
> The Printer object knows, what to do, so there is not the problem.
> But if the gambas-coder, after leaving the Printer.Setup(), wants to
> know if "Print to printer" or "Print to file" was chosen, he has as
> possibility only to ask if Printer.Name or Printer.file are filled.
>
> And that can be (as in Printer Properties.png shown) both one.   
>
> So what is needed, is a "target property" which says something like 
> target = printer or target = file  
>
> Gambas2=2.19.0                  Revision: 2654
> qt
>   
It seems to me, but I could be wrong, that if printer.file is filled, 
then the job goes to a file. If it is empty, then the job goes to a 
"real" printer. About the setup() dialog, may be it is bugged - I mean, 
perhaps it is possible to close the dialog and have both printer.file 
and printer.name set.

=== correction ===
it is bugged.
I made a simple project where setup() is called and just after return 
the values of .file and .name are printed. It is so easy to get them 
both set...

-- BUT THERE IS A WORKAROUND --

Just set printer.file="" before invoking setup(). Apparently they did 
more work than what is documented. This solves. The printer.file get set 
only if you press OK having "Print to file" checked.

Regards,
Doriano






More information about the User mailing list