Click or drag to resize
PMPrinterSetCostPerPageSize Method
Set cost per page size

Namespace: PM90SettingsAPI.Printer
Assembly: PM90SettingsAPI (in PM90SettingsAPI.dll) Version: 9.0.23.534 (9.0.23.534)
Syntax
C#
public void SetCostPerPageSize(
	List<PMPageSizeOverride> overrideSizes = null,
	Nullable<double> duplexDiscount = null,
	Nullable<double> economodeDiscount = null
)

Parameters

overrideSizes (Optional)
Type: System.Collections.GenericListPMPageSizeOverride
Optional list of sizes to set custom cost for. Global Page Size costs will be used for each size not specified and for all if null or empty list is passed.
duplexDiscount (Optional)
Type: SystemNullableDouble
Optional duplex discount to be applied when job is duplex. null will provide no discount
economodeDiscount (Optional)
Type: SystemNullableDouble
Optional economode discount to be applied when job is economode. null will provide no discount
Exceptions
ExceptionCondition
ArgumentOutOfRangeExceptionCosts are negative, or discount percentages are not between 1 - 100
Examples
Setting cost by page size
try
{

    //Get a reference to the printer object
    PMPrinter printer = PMPrinter.GetDirectPrintQueue("Server", "PrinterName");

    //Get all sizes
    List<PMPageSize> allSizes = PMPageSize.AvailablePageSizes();

    //Create custom costs for A4 and Letter
    PMPageSizeOverride A4_CustomCost = new PMPageSizeOverride(allSizes.Find(size => size.Name == "A4"), 0.50, 1.15);
    PMPageSizeOverride Letter_CutomCost = new PMPageSizeOverride(allSizes.Find(size => size.Name == "Letter"), 0.50, 1.15);

    //Set costs on printer
    printer.SetCostPerPageSize(new List<PMPageSizeOverride>() { A4_CustomCost, Letter_CutomCost });

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