code: def insertPage(
          doc,
          pno,
          text=None,
          fontsize=11,
          width=595,
          height=842,
          fontname="helv",
          fontfile=None,
          color=None,
      ):
      
      page = doc.newPage(pno=pno, width=width, height=height)
      if not bool(text):
          return 0
      rc = page.insertText(
              (50, 72),
              text,
              fontsize=fontsize,
              fontname=fontname,
              fontfile=fontfile,
              color=color,
           )
      return rc
docs: Create a new PDF page and insert some text.
  
      Notes:
          Function combining Document.newPage() and Page.insertText().
          For parameter details see these methods.