PMPageSizeRestriction Class |
Namespace: PM90SettingsAPI.Restrictions
public class PMPageSizeRestriction : PMRestriction
The PMPageSizeRestriction type exposes the following members.
Name | Description | |
---|---|---|
Disable |
Deactivates restriction, and any associated actions or messages
(Inherited from PMRestriction.) | |
Enable |
Enables restriction by page sizes
| |
SetDefaultRestriction |
Sets the default restriction for this action
|
Name | Description | |
---|---|---|
DefaultAction |
Gets the default action for this restriction type
(Inherited from PMRestriction.) | |
DefaultRestrictionAction |
Retrieves the default action for this restriction
| |
Enabled |
true if restriction is set on this object
(Inherited from PMRestriction.) | |
FilterType |
Indicates whether the page size list is whitelisted or blacklisted form of restriction
| |
OverrideAction |
The action applied by this restriction, on its specific object (i.e. user, etc...)
Value is null when using default action
(Inherited from PMRestriction.) | |
OverridingDefaultAction |
Indicates if the restriction has a custom action set for this object
(Inherited from PMRestriction.) | |
PageSizes |
Current list of restricted sizes
| |
Type |
Indicates which restriction this object represents
(Inherited from PMRestriction.) |
try { //Get a reference to the printer object PMPrinter printer = PMPrinter.GetDirectPrintQueue("Server", "PrinterName"); //Get all sizes List<PMPageSize> allSizes = PMPageSize.AvailablePageSizes(); //Create a list including letter and A4 List<PMPageSize> allowedSizes = new List<PMPageSize>(); allowedSizes.Add(allSizes.Find(size => size.Name == "Letter")); allowedSizes.Add(allSizes.Find(size => size.Name == "A4")); //Set allowedSizes as whitelist, all other sizes will not be allowed printer.PageSizeRestriction.Enable(allowedSizes, PMRestriction.ListType.WhiteList); } catch { //Error handling - See PM90SettingsAPI.Exceptions }