code: def write_pagerange(self, pagerange, prefix=''):
          
          writer = PdfFileWriter()
          slug = "".join([c for c in pagerange['title'].replace(" ", "-") if c.isalnum() or c == "-"])
          write_to_path = os.path.sep.join([self.directory, "{}{}.pdf".format(prefix, slug)])
          for page in range(pagerange['page_start'], pagerange['page_end']):
              writer.addPage(self.pdf.getPage(page))
              writer.removeLinks()                   # must be done every page
          with open(write_to_path, 'wb') as outfile:
              writer.write(outfile)
          return write_to_path
docs: Save the subset of pages specified in `pagerange` (dict) as separate PDF.
          e.g. pagerange = {'title':'First chapter', 'page_start':0, 'page_end':5}