Re: Get list of printers
Marc Santhoff <[email protected]> Thu, 07 Apr 2011 22:21:33 +0200
| Newsgroups | gmane.comp.openoffice.devel.api |
|---|---|
| Message-ID | <[email protected]> |
Am Donnerstag, den 07.04.2011, 09:48 -0400 schrieb Andrew Douglas
Pitonyak:
> Can I obtain a list of printers using Star Basic?
>
> It was my understanding that OOo has always had an easy method of
> obtaining a list of printers, but that this method was not available
> from Basic. With OOo 1.x and 2.x, I issued the ".uno:Print" dispatch and
> then used an interesting set of routines to directly manipulate the
> print dialog to obtain a list of printers (wish I could say it was my idea).
>
> The print dialog changed and this "cheater" method no longer works. I
> can pursue this method and modify it to work with the latest version of
> OOo (well, maybe I can), but, it would be nice if there were an easier way.
>
> I had hoped it would be as easy as
>
> CreateUnoService("com.sun.star.awt.PrinterServer")
>
> Unfortunately, the returned object is not usable.
>
Once upon a while I implemented a BASIC macro parsing the printer
configuration INI-style files. If that file format is still in use I
could dig for that macro and post it here or maybe make a snippet out of
it.
Their names where (on FreeBSD):
userdefname = resolveDollarVar("$(user)/psprint/psprint.conf")
globaldefname = resolveDollarVar("$(inst)/share/psprint/psprint.conf")
Marc
--
-----------------------------------------------------------------
To unsubscribe send email to [email protected]
For additional commands send email to [email protected]
with Subject: help