code: def getPageSizeByName(self, pageSizeName):
  		
  		pageSize = None
  
  		lowerCaseNames = {pageSize.lower(): pageSize for pageSize in
  		                  self.availablePageSizes()}
  		if pageSizeName.lower() in lowerCaseNames:
  			pageSize = getattr(QPagedPaintDevice, lowerCaseNames[pageSizeName.lower()])
  
  		return pageSize
docs: Returns a validated PageSize instance corresponding to the given
  		name. Returns None if the name is not a valid PageSize.