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: PPD key



Joris, thanks for contributing to this one. I just want to add a cautionary note on this topic. It would be a very serious problem if one vendor's PPD Plugins showed up in the Print dialog when another vendor's printer was selected. Therefore every PPD Plugin must check keywords like *Manufacturer, *Product, etc. in Initialize() and return kPMInvalidPDEContext if your plugin should not be loaded. Our sample code is at fault in this regard and we will update it as soon as we can.

-Paul

P.S. Please see the email I sent Feb 14 (Re: PPD-PDE Binding) which covers the same issue and includes some sample code.


On Thursday, February 27, 2003, at 03:50 AM, Joris Kempen wrote:

On 27-02-2003 11:20, "Jiang Hua" <email@hidden> wrote:

Dear all:

I develop a PDE. Now we want to check if the PPD support our function or not
so that we can load/unload our PDE.
Maybe we can check the *Manufacturer option. How to check this key. Maybe we
want to add a key in PPD file.
for example: *Function1: "Supported". How to check this key?


Look in the OutPutBin example, in the Initialize functionis you can find the
exact code to check if a PPD keyword is in the PPD file of the current Job.

A snippet from my code:

err = ppdOpenCompiledPPDFromTicket(printerInfo, &ppdContext,
&tempFSSpec);

if(err == noErr)
{
mIndex = ppdGetMainIndex(ppdContext, (const
StringPtr)kOCStaplePDEKey);

// no valid key found
if(mIndex == kPPDInvalidIndex)
{
err = kPMInvalidKey;
}
// close the PPD and delete the file
ppdCloseCompiledPPDFromTicket(ppdContext, &tempFSSpec);
}


KOCStaplePDEKey is defined as:
// PPD keys to look for in OCStaplePDE
const unsigned char* kOCStaplePDEKey = "\pOCStaplePDE";

The "*" is not included.

In my PPD the key is defined as:
*OCStaplePDE : True

Hope this is enough help for you.

Gr. Joris
_______________________________________________
printing mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/printing
Do not post admin requests to the list. They will be ignored.
_______________________________________________
printing mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/printing
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: PPD key (From: Joris Kempen <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.