[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Downloading fonts to printer...



At 10:21 PM +0100 5/15/99, Alan Fry wrote:
>It may be easier to find an answer to question 2. If you have a list of PS
>printers by name you can get each of them up in turn using the 'Chooser' -
>yes?
>Now there is an OSAX called 'Set Printer to' which will alllow you to do
>this from MacPerl using AppleScript.
>
>Having got a particular printer connected to the machine, you can then
>address it with 'Dev:Printer'.

I was hoping for a more directly perl solution - although a lot of you may
find that strange, given my tendancy to spout AppleScript at the drop of a
hat.

Does Dev:Printer have no mechanisms for being pointed to anything other
than the currently selected printer?  Shouldn't I be able to open a socket
or something?  Or does that just get really really messy?

Just an idle thought about filtering the list of all printers on the
network.  Not to add to Chris' overloaded list of things to do, but I think
someone (and I wish I had the ability to do it) should be working on a
module to use SLP - or have I not been paying enough attention?  Is someone
working on a Network Browser module (aside from a glue module, that is)?

> You have two options I think. You could ask
>the printer (in PostScript) whether the fonts you are interested in are in
>defined in the FontDirectory, or you could ask the printer to send a list
>of all the fonts it has in the FontDirectory and then get Perl to look at
>the list and see if any of the ones you're interested in are missing. I
>think the second option must be preferable.

I agree that the second option is preferable - and in fact, it might be
easier than that.  I don't really know what happens if you try and upload a
font that's already there, but I'd hope that the download would just
overwrite the "old" font, or essentially fail gracefully.

Well... I tried it with Apple Printer Utility. It gave me a dialog box -
which suggests that at least APU knows that there are duplicate fonts being
downloaded.  It did give me the option to download all fonts - which seems
to have worked okay.

>To do this you could modify the
>MacPerl script (as before) to read something like:
>
>Question 1 implies you have a list of printers on the network, but the list
>may include nxon-PS printers. It may be that the 'Chooser' can help here,
>since if a PostScript driver icon is clicked on the left-hand side of the
>Chooser window only PS printers will appear in the list on the right hand
>side. At least I think that is so -- I can't set up a mini-network to test
>that statement.

Yes, that's true.  Chooser devices do a good bit of filtering.  If the
Chooser were scriptable...

>
>That being so, if you send an AppleEvent which asks for <set printer to
>"LaserWriter 8" named "StyleWriter"> an error should result. If you can
>find a way of trapping the error without crashing the machine, it will have
>established that that particular printer in the list is a non-PS printer.

Trapping that would be easy inside applescript.

>
>Hope these thoughts are some help.

Again, very helpful.  Thanks!

-Jeff Lowrey



===== Want to unsubscribe from this list?
===== Send mail with body "unsubscribe" to macperl-request@macperl.org