code: def _get_print_area(self):
          
  
          # Get print area from current selection
          selection = self.main_window.grid.selection
          print_area = selection.get_bbox()
  
          # If there is no selection use the visible area on the screen
          if print_area is None:
              print_area = self.main_window.grid.actions.get_visible_area()
  
          return print_area
docs: Returns selection bounding box or visible area