Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Widget Limitation



> Hi,
> Is there any way to manipulate with printer from widget.
> I tried executing window.print() using _javascript_, did not do anything. It
> was just a starting point. Can I do more than that, for example resizing the
> document size before printing etc.
> If that is not possible can I manipulate printer through print center by
> calling system.
>
> Thank you.

Although you cannot print from JS right now, as Mr. Louch explained, you can still print if you want to.  You will simply need to call it from a plugin.  Calling a print operation is simple and requires very little code. Somthing like:

NSPrintOperation *op = [NSPrintOperation printOperationWithView:self printInfo:[self printInfo]];
[op setShowPanels:NO]; // You will not want the Print Panel in Dashboard
[op runOperation];  //Send to the queue

I would recommend reading the NSPrintOperation documentation.  This of course would just be a workaround until the Dashboard team creates an easier way.


Mike Marmarou
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Dashboard-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/dashboard-dev/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.