InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IPrintDeviceInfo Class Referenceabstract

#include <IPrintDeviceInfo.h>

Inheritance diagram for IPrintDeviceInfo:
IPMUnknown

Public Types

enum  { kDefaultIID = IID_IPRINTDEVICEINFO }
 
enum  SetupDialogType { kPrinterSetup, kPageSetup }
 
enum  DefColorSpace { kGray, kRGB, kCMYK, kUnchanged }
 
enum  PSLevel { kPSLevel_Unknown, kPSLevel_1, kPSLevel_2, kPSLevel_3 }
 
enum  InkSelector {
  kCyan, kMagenta, kYellow, kBlack,
  kSpot
}
 

Public Member Functions

virtual bool16 IsPrintSessionActive () const =0
 
virtual void Begin (bool16 initPPDList=kTrue)=0
 
virtual void End ()=0
 
virtual ErrorCode ProcessPlatformPrintDialog (SetupDialogType dialogType, IOutputPages *iOutputPages=nil)=0
 
virtual ErrorCode UpdatePrinterInfo (PMString &newPrinterStr, PMString &newPPDModelStr, bool16 bUsePrintData=kFalse, PMString newPPDFileStr=PMString())=0
 
virtual bool16 HasDefaultPrinter () const =0
 
virtual PMString GetDefaultPrinterName () const =0
 
virtual bool16 IsDefaultPrinterPDFWriter () const =0
 
virtual int32 GetNumDevices () const =0
 
virtual PMString GetNthDevice (const int32 index) const =0
 
virtual int32 GetDeviceIndex (const PMString &deviceName) const =0
 
virtual int32 GetNumPPDNames () const =0
 
virtual PMString GetNthPPDModelName (const int32 index) const =0
 
virtual PMString GetNthPPDFileName (const int32 index) const =0
 
virtual int32 GetPPDIndexFromModelName (const PMString &ppdModelName) const =0
 
virtual int32 GetPPDIndexFromFileName (const PMString &ppdFileName) const =0
 
virtual int32 GetNumPaperSizes () const =0
 
virtual PMString GetNthPaperSize (const int32 index) const =0
 
virtual int32 GetPaperSizeIndex (const PMString &paperSizeName) const =0
 
virtual PMString GetMediaSizeName () const =0
 
virtual PMString GetPaperSizeName (const PMString &mediaSizeName) const =0
 
virtual PMString GetPaperSizeName (const PMRect &paperSizeRect, const PMRect &imageableAreaRect=PMRect(), const PMString &paperSizeName=PMString()) const =0
 
virtual PMRect GetPaperSize (const int32 index=0) const =0
 
virtual PMRect GetImageablePaperSize (const int32 index=0) const =0
 
virtual uchar * GetPaperSizeSelector (uint32 &outSize, const int32 index=0) const =0
 
virtual bool16 GetDeviceSupportsCustomPaperSizes () const =0
 
virtual bool16 GetDeviceSupportsCustomPaperTransverse () const =0
 
virtual void GetDeviceCustomPaperWidthRange (PMReal &outMinWidth, PMReal &outMaxWidth) const =0
 
virtual void GetDeviceCustomPaperHeightRange (PMReal &outMinHeight, PMReal &outMaxHeight) const =0
 
virtual void GetDeviceCustomPaperWidthOffsetRange (PMReal &outMinOffset, PMReal &outMaxOffset) const =0
 
virtual bool16 GetDeviceSupportsInRIPTrapping () const =0
 
virtual bool16 GetDeviceSupportsInRIPSeparations () const =0
 
virtual bool16 GetDeviceSupportsBinaryData () const =0
 
virtual DefColorSpace GetDeviceDefaultColorSpace () const =0
 
virtual bool16 GetDeviceSupportsColorSpace (DefColorSpace colorSpace) const =0
 
virtual bool16 IsPostScriptDevice () const =0
 
virtual bool16 DeviceSupportsNormalizedPostScript () const =0
 
virtual PSLevel GetDevicePostScriptLevel () const =0
 
virtual int32 GetNumCompositeFrequencies () const =0
 
virtual PMString GetNthCompositeFrequency (const int32 index) const =0
 
virtual PMReal GetDeviceCompositeAngle (PMString &resStr) const =0
 
virtual PMReal GetDeviceCompositeFrequency (PMString &resStr) const =0
 
virtual int32 GetCompositeFrequencyIndex (const PMString &compFreqName) const =0
 
virtual int32 GetNumSeparationFrequencies () const =0
 
virtual PMString GetNthSeparationFrequency (const int32 index) const =0
 
virtual int32 GetSeparationFrequencyIndex (const PMString &sepFreqName) const =0
 
virtual int32 GetDefaultSeparationFrequencyIndex () const =0
 
virtual PMReal GetDeviceDefaultInkAngle (InkSelector inInkSelector) const =0
 
virtual PMReal GetDeviceDefaultInkFrequency (InkSelector inInkSelector) const =0
 
virtual PMReal GetDeviceInkAngle (InkSelector inInkSelector, PMString &resStr) const =0
 
virtual PMReal GetDeviceInkFrequency (InkSelector inInkSelector, PMString &resStr) const =0
 
virtual bool16 GetDeviceRequiresFlattener () const =0
 
virtual ErrorCode GetPPDValues (PMString &keyIn, K2Vector< KeyValuePair< PMString, PMString > > &valueOut) const =0
 
virtual ErrorCode GetPPDOptionKeys (PMString &keyIn, K2Vector< PMString > &keysOut) const =0
 
virtual ErrorCode GetPPDOptionValue (PMString &keyIn, PMString &subKeyIn, PMString &subKeyTranslationOut, K2Vector< KeyValuePair< PMString, PMString > > &valueOut) const =0
 
- Public Member Functions inherited from IPMUnknown
virtual IPMUnknownQueryInterface (PMIID interfaceID) const =0
 
virtual void AddRef () const =0
 
virtual void Release () const =0
 

Detailed Description

Helper class with access to information about the currently targetted printer. When using this interface, the first thing called should be the Begin method. The End method should be called when finished.

See Also
IPrintData

Member Enumeration Documentation

anonymous enum

Default enum.

Default color spaces
Enumerator
kGray 

Gray color space

kRGB 

RGB color space

kCMYK 

CMYK color space

kUnchanged 

Unchanged color space

Ink selector for retrieving frequency and angle information.
Enumerator
kCyan 

Cyan

kMagenta 

Magenta

kYellow 

Yellow

kBlack 

Black

kSpot 

Spot

PostScript level
Enumerator
kPSLevel_Unknown 

PostScript level unknown

kPSLevel_1 

PostScript level 1

kPSLevel_2 

PostScript level 2

kPSLevel_3 

PostScript level 3

Used when accessing the platform print or page setup dialogs through ProcessPlatformPrintDialog.
Enumerator
kPrinterSetup 

Access printer setup dialog

kPageSetup 

Access the page setup dialog (Mac only)

Member Function Documentation

virtual void IPrintDeviceInfo::Begin (bool16 initPPDList = kTrue)
pure virtual

Start a print session.

Parameters
initPPDListIN whether to initialize the PPD list or not
virtual bool16 IPrintDeviceInfo::DeviceSupportsNormalizedPostScript () const
pure virtual

Does a non-PS device support behaving like a PS device by distilling (or "normalizing") the PS into PDF, then converting the PDF to the device's native format (usually bitmaps of some sort)? Notes: 1) This is currently only supported on Mac OS versions >= 10.3; 2) By definition this is mutually exclusive with IsPostScriptDevice - when one is true the other will be false.

Returns
bool16 kTrue if the current printer supports the normalize PostScript path, kFalse otherwise
virtual void IPrintDeviceInfo::End ()
pure virtual

End the print session.

virtual int32 IPrintDeviceInfo::GetCompositeFrequencyIndex (const PMStringcompFreqName) const
pure virtual

Get the composite frequency index - This method has been depricated - don't use.

Parameters
compFreqNameIN this parameter is currently ignored
Returns
int32 will always return -1
virtual PMString IPrintDeviceInfo::GetDefaultPrinterName () const
pure virtual

Return the name of the default printer, if one is defined.

Returns
PMString containing the default printer name, if no default printer is defined, string will be empty
virtual int32 IPrintDeviceInfo::GetDefaultSeparationFrequencyIndex () const
pure virtual

Get the default separation frequency index.

Returns
int32 the default separation frequency index
virtual PMReal IPrintDeviceInfo::GetDeviceCompositeAngle (PMStringresStr) const
pure virtual

Get the composite angle.

Parameters
resStrIN this parameter is current ignored
Returns
PMReal the composite angle (ScreenAngle from PPD), or 45 if not found
virtual PMReal IPrintDeviceInfo::GetDeviceCompositeFrequency (PMStringresStr) const
pure virtual

Get the composite frequency.

Parameters
resStrIN this parameter is current ignored
Returns
PMReal the composite angle (ScreenFreq from PPD), or 70 if not found
virtual void IPrintDeviceInfo::GetDeviceCustomPaperHeightRange (PMRealoutMinHeight,
PMRealoutMaxHeight 
) const
pure virtual

Get the custom paper height range for the printer.

Parameters
outMinHeightOUT the minimum custom paper height supported
outMaxHeightOUT the maximum custom paper height supported
virtual void IPrintDeviceInfo::GetDeviceCustomPaperWidthOffsetRange (PMRealoutMinOffset,
PMRealoutMaxOffset 
) const
pure virtual

Get the custom paper width offset range for the printer.

Parameters
outMinOffsetOUT the minimum custom paper width offset supported
outMaxOffsetOUT the maximum custom paper width offset supported
virtual void IPrintDeviceInfo::GetDeviceCustomPaperWidthRange (PMRealoutMinWidth,
PMRealoutMaxWidth 
) const
pure virtual

Get the custom paper width range for the printer.

Parameters
outMinWidthOUT the minimum custom paper width supported
outMaxWidthOUT the maximum custom paper width supported
virtual DefColorSpace IPrintDeviceInfo::GetDeviceDefaultColorSpace () const
pure virtual

Get the default color space for the current printer.

Returns
DefColorSpace enum value for the default color space
virtual PMReal IPrintDeviceInfo::GetDeviceDefaultInkAngle (InkSelector inInkSelector) const
pure virtual

Get the default ink angle for the given ink.

Parameters
inInkSelectorIN which ink to get
Returns
PMReal the default angle
virtual PMReal IPrintDeviceInfo::GetDeviceDefaultInkFrequency (InkSelector inInkSelector) const
pure virtual

Get the default ink frequency for the given ink.

Parameters
inInkSelectorIN which ink to get
Returns
PMReal the default frequency
virtual int32 IPrintDeviceInfo::GetDeviceIndex (const PMStringdeviceName) const
pure virtual

Given a printer name (i.e. IPrintData::GetPrinter()), get its index in the printer list.

Parameters
deviceNameIN the printer name to find
Returns
int32 the index of the given printer in the printer list, -1 if not in the list
virtual PMReal IPrintDeviceInfo::GetDeviceInkAngle (InkSelector inInkSelector,
PMStringresStr 
) const
pure virtual

Get the ink angle for the given ink and separation screen string.

Parameters
inInkSelectorIN which ink to get
resStrIN the separation screen text string (i.e. IPrintData::GetSeparationScreenText())
Returns
PMReal the ink angle
virtual PMReal IPrintDeviceInfo::GetDeviceInkFrequency (InkSelector inInkSelector,
PMStringresStr 
) const
pure virtual

Get the ink frequency for the given ink and separation screen string.

Parameters
inInkSelectorIN which ink to get
resStrIN the separation screen text string (i.e. IPrintData::GetSeparationScreenText())
Returns
PMReal the ink frequency
virtual PSLevel IPrintDeviceInfo::GetDevicePostScriptLevel () const
pure virtual

Get the PostScript level supported by the current printer.

Returns
PSLevel enum of the highest PostScript level supported by the printer
virtual bool16 IPrintDeviceInfo::GetDeviceRequiresFlattener () const
pure virtual

Get whether the current printer requires the flattener.

Returns
bool16 if the printer requires the flattener, kFalse otherwise
virtual bool16 IPrintDeviceInfo::GetDeviceSupportsBinaryData () const
pure virtual

Get whether the current printer supports binary data.

Returns
bool16 kTrue if the printer supports binary data, kFalse otherwise
virtual bool16 IPrintDeviceInfo::GetDeviceSupportsColorSpace (DefColorSpace colorSpace) const
pure virtual

Determine if the printer supports a given color space.

Parameters
colorSpaceIN the color space to check
Returns
bool16 kTrue if the printer supports the given color space, kFalse otherwise
virtual bool16 IPrintDeviceInfo::GetDeviceSupportsCustomPaperSizes () const
pure virtual

Does the current printer support custom paper sizes.

Returns
bool16 kTrue if the current printer supports custom paper sizes, kFalse otherwise
virtual bool16 IPrintDeviceInfo::GetDeviceSupportsCustomPaperTransverse () const
pure virtual

Does the current printer support transverse paper.

Returns
bool16 kTrue if the current printer supports transverse paper, kFalse otherwise
virtual bool16 IPrintDeviceInfo::GetDeviceSupportsInRIPSeparations () const
pure virtual

Get whether the current printer supports in RIP separations.

Returns
bool16 kTrue if the printer supports in RIP separations, kFalse otherwise
virtual bool16 IPrintDeviceInfo::GetDeviceSupportsInRIPTrapping () const
pure virtual

Get whether the current printer supports in RIP trapping.

Returns
bool16 kTrue if the printer supports in RIP trapping, kFalse otherwise
virtual PMRect IPrintDeviceInfo::GetImageablePaperSize (const int32 index = 0) const
pure virtual

Get the nth imageable area rect.

Parameters
indexthe imageable area rect to get - NOTE: index ignored if kPaperSizeDefinedByDriver or kPaperSizeDefinedByUser
Returns
PMRect the rect of the imageable area
virtual PMString IPrintDeviceInfo::GetMediaSizeName () const
pure virtual

Get the media paper size name out of the Print Record (print driver settings). Can be used as the parameter passed to GetPaperSizeName to determine media name. Will return an empty string if not printing to a printer, or if Custom or Defined by Driver paper setting is selected.

Returns
PMString containing the media size name
virtual PMString IPrintDeviceInfo::GetNthCompositeFrequency (const int32 index) const
pure virtual

Get the nth composite frequency - This method has been depricated - don't use.

Parameters
indexIN this parameter is current ignored
Returns
PMString will always return an empty string
virtual PMString IPrintDeviceInfo::GetNthDevice (const int32 index) const
pure virtual

Get the name of the nth printer.

Parameters
indexIN which printer to get
Returns
PMString the name of the nth printer
virtual PMString IPrintDeviceInfo::GetNthPaperSize (const int32 index) const
pure virtual

Get the name of the nth paper size.

Parameters
indexIN which paper size to get
Returns
PMString containing the nth paper size name
virtual PMString IPrintDeviceInfo::GetNthPPDFileName (const int32 index) const
pure virtual

Get the nth PPD file name.

Parameters
indexIN which index to get
Returns
PMString contining the nth PPD file name
virtual PMString IPrintDeviceInfo::GetNthPPDModelName (const int32 index) const
pure virtual

Get the nth PPD model name.

Parameters
indexIN which index to get
Returns
PMString contining the nth PPD model name
virtual PMString IPrintDeviceInfo::GetNthSeparationFrequency (const int32 index) const
pure virtual

Get the nth separation frequency.

Parameters
indexIN which separation frequency to get
Returns
PMString containing the nth separation frequency
virtual int32 IPrintDeviceInfo::GetNumCompositeFrequencies () const
pure virtual

Get the number of composite frequencies - This method has been depricated - don't use.

Returns
int32 will always return 0
virtual int32 IPrintDeviceInfo::GetNumDevices () const
pure virtual

Get the number of printers on the system.

Returns
int32 the number of printers on the system
virtual int32 IPrintDeviceInfo::GetNumPaperSizes () const
pure virtual

Get the number of paper sizes available.

Returns
int32 the number of paper sizes available
virtual int32 IPrintDeviceInfo::GetNumPPDNames () const
pure virtual

Get the number of PPDs on the system.

Returns
int32 the number of PPDs on the system
virtual int32 IPrintDeviceInfo::GetNumSeparationFrequencies () const
pure virtual

Get the number of separation frequencies.

Returns
int32 the number of separation frequencies
virtual PMRect IPrintDeviceInfo::GetPaperSize (const int32 index = 0) const
pure virtual

Get the nth paper size rect.

Parameters
indexIN the paper size rect to get - NOTE: index ignored if kPaperSizeDefinedByDriver or kPaperSizeDefinedByUser
Returns
PMRect the rect of the paper size
virtual int32 IPrintDeviceInfo::GetPaperSizeIndex (const PMStringpaperSizeName) const
pure virtual

Get the index of the given paper size name.

Parameters
paperSizeNameIN the paper size name to find
Returns
int32 the index of the given paper size name in the paper size list
virtual PMString IPrintDeviceInfo::GetPaperSizeName (const PMStringmediaSizeName) const
pure virtual

Given the media size name (from the PrintRecord), search for the name in the list that comes from the PPD. Alternative to using paper size and imageable area rects.

Parameters
mediaSizeNameIN the name of the media to find
Returns
PMString the name of the paper size
virtual PMString IPrintDeviceInfo::GetPaperSizeName (const PMRectpaperSizeRect,
const PMRectimageableAreaRect = PMRect(),
const PMStringpaperSizeName = PMString() 
) const
pure virtual

Given the paper size rect, and the optional imageable area rect, find the paper size name.

Parameters
paperSizeRectIN the paper size rect to find
imageableAreaRectIN the optional imageable area rect to further refine the search - i.e. the difference between finding Letter and Letter Small paper sizes
Returns
PMString the name of the paper size
virtual uchar* IPrintDeviceInfo::GetPaperSizeSelector (uint32 & outSize,
const int32 index = 0 
) const
pure virtual

Get the paper size selector (a magic cookie) for the given index. Used in IPrintData Get/Set Paper Size Selector. Note: the caller is responsible for freeing the non-nil pointer returned, using delete[].

Parameters
outSizeOUT size of the memory block allocated and passed back
indexIN which paper size selector to get - NOTE: index ignored if kPaperSizeDefinedByDriver or kPaperSizeDefinedByUser
Returns
uchar pointer to memory block containing selector - NOTE: caller is responsible for freeing this memory!
virtual int32 IPrintDeviceInfo::GetPPDIndexFromFileName (const PMStringppdFileName) const
pure virtual

Get the index of the given PPD file name.

Parameters
ppdFileNameIN the PPD file name to find
Returns
int32 the index into the list of PPDs for the given file name, -1 if not found
virtual int32 IPrintDeviceInfo::GetPPDIndexFromModelName (const PMStringppdModelName) const
pure virtual

Get the index of the given PPD model name.

Parameters
ppdModelNameIN the PPD model name to find
Returns
int32 the index into the list of PPDs for the given model name, -1 if not found
virtual ErrorCode IPrintDeviceInfo::GetPPDOptionKeys (PMStringkeyIn,
K2Vector< PMString > & keysOut 
) const
pure virtual

PPD parsing - get PPD option keys.

Parameters
keyInIN the key to look up
keysOutOUT a K2Vector of key strings to use as subKeyIn to GetPPDOptionValue()
Returns
ErrorCode kSuccess if successful, kFailure otherwise
virtual ErrorCode IPrintDeviceInfo::GetPPDOptionValue (PMStringkeyIn,
PMStringsubKeyIn,
PMStringsubKeyTranslationOut,
K2Vector< KeyValuePair< PMString, PMString > > & valueOut 
) const
pure virtual

PPD parsing - get PPD option value.

Parameters
keyInIN the key to look up
subKeyInIN sub key to lookup - from GetPPDOptionKeys()
subKeyTranslationOutOUT translation of the subKeyIn
valueOut- K2Lookup of two strings, first string is the text, second string is translation
Returns
ErrorCode kSuccess if successful, kFailure otherwise
virtual ErrorCode IPrintDeviceInfo::GetPPDValues (PMStringkeyIn,
K2Vector< KeyValuePair< PMString, PMString > > & valueOut 
) const
pure virtual

PPD parsing - get PPD values.

Parameters
keyInIN the key to look up
valueOutOUT a K2Vector of key/value pairs for the given PPD key, where the first string is the text, second string is translation
Returns
ErrorCode kSuccess if successful, kFailure otherwise
virtual int32 IPrintDeviceInfo::GetSeparationFrequencyIndex (const PMStringsepFreqName) const
pure virtual

Get the index of the given separation frequency.

Parameters
sepFreqNameIN the separation frequency to find
Returns
int32 the index of the given separation frequency, -1 if not found
virtual bool16 IPrintDeviceInfo::HasDefaultPrinter () const
pure virtual

Check to see if there is a default printer defined

Returns
bool16 kTrue if default printer defined, kFalse otherwise
virtual bool16 IPrintDeviceInfo::IsDefaultPrinterPDFWriter () const
pure virtual

Check to see if the default printer is a PDFWriter. We do not allow printing to Acrobat PDFWriter.

Returns
bool16 kTrue if default printer is a PDFWriter, kFalse otherwise
virtual bool16 IPrintDeviceInfo::IsPostScriptDevice () const
pure virtual

Is the current printer a PostScript printer?

Returns
bool16 kTrue if the current printer is a PostScript device, kFalse otherwise
virtual bool16 IPrintDeviceInfo::IsPrintSessionActive () const
pure virtual

PrintDeviceInfo must be bracketed by Begin/End - this call tells whether we are in between a Begin/End construct.

Returns
bool16 kTrue if there is a print session active, kFalse otherwise
virtual ErrorCode IPrintDeviceInfo::ProcessPlatformPrintDialog (SetupDialogType dialogType,
IOutputPagesiOutputPages = nil 
)
pure virtual

Access the platform print setup or page setup dialog - calls the system printer driver's dialogs.

Parameters
dialogTypeIN which dialog to access
iOutputPagesIN pointer to IOutputPages - if supplied will attempt to match bounds of pages with print record page sizes. May be nil.
virtual ErrorCode IPrintDeviceInfo::UpdatePrinterInfo (PMStringnewPrinterStr,
PMStringnewPPDModelStr,
bool16 bUsePrintData = kFalse,
PMString newPPDFileStr = PMString() 
)
pure virtual

Called when printers change to update PrintData. If bUsePrintData is true, the newPrinterStr and newPPDStr are ignored, and only the print record in the PrintData is used. If newPrinterStr == "kPrepress File", checks newPPDStr. If newPPDModelStr == "kDevice Independent", inits for Prepress otherwise inits to PPD file passed in newPPDFileStr. Else if newPrinterStr is empty, initializes using system default printer. Else inits to printer passed in newPrinterStr.

Parameters
newPrinterStrIN string containing the new printer - i.e. from IPrintData::GetPrinter()
newPPDModelStrIN string containing the PPD - i.e. from IPrintData::GetPPDName()
bUsePrintDataIN If true, the newPrinterStr and newPPDStr are ignored, and only the print record in the PrintData is used. If false, newPrinterStr and newPPDStr are used as described.
newPPDFileStrIN string containing the PPD file - i.e. from IPrintData::GetPPDFile()
Returns
ErrorCode will return kSuccess if successful, an error return code otherwise