Hello
Im working on a Photoshop CS2/CS3 plugin. I need to set the ICC profile when printing. I have code that does this, it works fine when I catch the eventOpen event:
sPSActionControl-%26gt;AddNotify(this-%26gt;GetPluginRef(), eventOpen, _EventOpen, this);
Here is the code that I use in my eventOpen handler: (Ive removed all error checking just to make it shorter for this email.)
error = sPSActionDescriptor-%26gt;Make(%26amp;desc0xe0);
error = sPSActionReference-%26gt;Make(%26amp;ref0x30);
error = sPSActionControl-%26gt;StringIDToTypeID(''printOptions'', %26amp;runtimePropID);
error = sPSActionReference-%26gt;PutProperty(ref0x30, classProperty, runtimePropID);
error = sPSActionReference-%26gt;PutEnumerated(ref0x30, classDocument, typeOrdinal, enumTarget);
error = sPSActionDescriptor-%26gt;PutReference(desc0xe0, keyNull, ref0x30);
error = sPSActionDescriptor-%26gt;Make(%26amp;desc0xe8);
error = sPSActionDescriptor-%26gt;Make(%26amp;desc0xf0);
error = sPSActionDescriptor-%26gt;PutObject(desc0xe8, keyPageSetup, classPageSetup, desc0xf0);
error = sPSActionDescriptor-%26gt;Make(%26amp;desc0xf8);
spaceID = enumCMYKColor;
error = sPSActionDescriptor-%26gt;PutEnumerated(desc0xf8, keyColorSpace, typeColorSpace, spaceID);
error = sPSActionDescriptor-%26gt;PutString(desc0xf8, keyName, _printProfile);
error = sPSActionDescriptor-%26gt;PutEnumerated(desc0xf8, keyIntent, typeIntent, enumImage);
error = sPSActionDescriptor-%26gt;PutBoolean(desc0xf8, keyMapBlack, true);
error = sPSActionDescriptor-%26gt;PutObject(desc0xe8, keyPrintSettings, 'PMps', desc0xf8);
error = sPSActionControl-%26gt;StringIDToTypeID(''printOptions'', %26amp;runtimeObjID);
error = sPSActionDescriptor-%26gt;PutObject(desc0xe0, keyTo, runtimeObjID, desc0xe8);
error = sPSActionControl-%26gt;Play(%26amp;result, eventSet, desc0xe0, plugInDialogDontDisplay);
There are two problems with my code, one of which is pretty serious. When I print and change the printer profile from the Print dialog, the profile selected in the dialog is used, not the one that I select in code. (Lets not debate if this is a good idea or not...).
So I also catch eventPrint:
sPSActionControl-%26gt;AddNotify(this-%26gt;GetPluginRef(), eventPrint, _EventPrint, this);
And I call the exact same code in my eventPrint handler. The problem is that the ICC profile I specified in the plugin isnt being used. Instead, the ICC profile specified in the dialog is being used. Im guessing that my code is run and THEN the dialog is scraped for data. This is clearly a show stopper for the desired behavior.
The other problem is an odd one. When my code is run the resolution of the image is set to 72 dpi. I guess I can read the resolution and set it in this code to the original resolution but that seems odd, Id rather prevent it from being set in the first place.
Thanks for looking at this and for any advice you can give.
Paul
Subscribe to:
Post Comments
(Atom)
No comments:
Post a Comment