Click or drag to resize
PMPrinterGetCostProfile Method
Gets a PMPrinter object representing a cost profile

Namespace: PM90SettingsAPI.Printer
Assembly: PM90SettingsAPI (in PM90SettingsAPI.dll) Version: 9.0.23.534 (9.0.23.534)
Syntax
C#
public static PMPrinter GetCostProfile(
	string queuename = null
)

Parameters

queuename (Optional)
Type: SystemString
Name of the cost profile. Supplying null will pull the default cost profile.

Return Value

Type: PMPrinter
New PMPrinter instance, or null if not found.
Exceptions
ExceptionCondition
PMDatabaseConnectionNotFoundExceptionNo database connection available on this system
PMDatabaseExceptionRepresents an database connection or syntax error that has occurred when processing an API request
PMExceptionUnexcpected exception has occurred, check inner exception
Examples
Setting costs on the default cost profile
try
{

    //Get the default cost profile
    PMPrinter profile = PMPrinter.GetCostProfile();

    //Set cost profile to 0.10 for BW, 0.85 for color, 25% Duplex Discount
    profile.SetCostPerPage(.10, .85, 25, null);

}
catch
{
    //Error handling - See PM90SettingsAPI.Exceptions
}
See Also