Click or drag to resize
PMPageSizeRestriction Class
Represents an instance of a blacklisted page sizes, or allowed (whitelisted) page size restriction
Inheritance Hierarchy
SystemObject
  PM90SettingsAPI.RestrictionsPMRestriction
    PM90SettingsAPI.RestrictionsPMPageSizeRestriction

Namespace: PM90SettingsAPI.Restrictions
Assembly: PM90SettingsAPI (in PM90SettingsAPI.dll) Version: 9.0.23.534 (9.0.23.534)
Syntax
C#
public class PMPageSizeRestriction : PMRestriction

The PMPageSizeRestriction type exposes the following members.

Methods
  NameDescription
Public methodDisable
Deactivates restriction, and any associated actions or messages
(Inherited from PMRestriction.)
Public methodEnable
Enables restriction by page sizes
Public methodStatic memberSetDefaultRestriction
Sets the default restriction for this action
Top
Properties
  NameDescription
Public propertyDefaultAction
Gets the default action for this restriction type
(Inherited from PMRestriction.)
Public propertyStatic memberDefaultRestrictionAction
Retrieves the default action for this restriction
Public propertyEnabled
true if restriction is set on this object
(Inherited from PMRestriction.)
Public propertyFilterType
Indicates whether the page size list is whitelisted or blacklisted form of restriction
Public propertyOverrideAction
The action applied by this restriction, on its specific object (i.e. user, etc...) Value is null when using default action
(Inherited from PMRestriction.)
Public propertyOverridingDefaultAction
Indicates if the restriction has a custom action set for this object
(Inherited from PMRestriction.)
Public propertyPageSizes
Current list of restricted sizes
Public propertyType
Indicates which restriction this object represents
(Inherited from PMRestriction.)
Top
Examples
Setting a page size restriction on a printer
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
}
See Also