title: PyPDF2 append a PDF from the 2nd page
body: <p>I'm learning how to program using the "automate the boring stuff"-book, I have, however stumbled upon a roadblock in chapter 13.
  "Merge multiple PDF's, but omit the title page from all but the first page"</p>
  
  <p>In the book, they do it by looping over the PDF, however, while looking into PyPDF2 module, I found the 'pages'-option a cleaner solution. I, however, have difficulties to get this to work.</p>
  
  <p>Don't look yet if it is pythonic or something. I still haven't learned classes ;-) After the book, I plan on starting with classes, objects, decorators, *args and **kwargs ;-)</p>
  
  <p>I need help in the last line of code of my snippet.</p>
  
  <p>My code:</p>
  
  <pre><code>  for fn_PdfObjects in range(len(l_fn_PdfObjects)):
  if fn_PdfObjects != 0:
       break
  else:
    ## watermark the first sheet
    addWatermark(l_fn_PdfObjects[fn_PdfObjects])
    watermarkedPage = PyPDF2.PdfFileReader(open('watermarkedCover.pdf', 'rb'))
    #   the 'position = ' is the page in the destination PDF it will receive
    tempMergerFile.merge(position=fn_PdfObjects, fileobj=watermarkedPage)
    tempMergerFile.merge(position=fn_PdfObjects+1, fileobj=l_fn_PdfObjects[fn_PdfObjects],pages='0:')
  </code></pre>
  
  <p>When looking at the module, I find this:
  src: <a href="https://pythonhosted.org/PyPDF2/PdfFileMerger.html" rel="nofollow">https://pythonhosted.org/PyPDF2/PdfFileMerger.html</a></p>
  
  <blockquote>
    <p>merge(position, fileobj, bookmark=None, pages=None, import_bookmarks=True)</p>
    
    <p>pages – can be a Page Range or a (start, stop[, step]) tuple to merge only the specified range of pages from the source document into the output document.</p>
  </blockquote>
  
  <p>I also found this about page_ranges, but whatever I try, I can't get it to work:
  src: <a href="https://github.com/mstamy2/PyPDF2/blob/master/PyPDF2/pagerange.py" rel="nofollow">https://github.com/mstamy2/PyPDF2/blob/master/PyPDF2/pagerange.py</a></p>
  
  <pre><code>class PageRange(object):
  """
  A slice-like representation of a range of page indices,
      i.e. page numbers, only starting at zero.
  The syntax is like what you would put between brackets [ ].
  The slice is one of the few Python types that can't be subclassed,
  but this class converts to and from slices, and allows similar use.
    o  PageRange(str) parses a string representing a page range.
    o  PageRange(slice) directly "imports" a slice.
    o  to_slice() gives the equivalent slice.
    o  str() and repr() allow printing.
    o  indices(n) is like slice.indices(n).
  """
  
  def __init__(self, arg):
      """
      Initialize with either a slice -- giving the equivalent page range,
      or a PageRange object -- making a copy,
      or a string like
          "int", "[int]:[int]" or "[int]:[int]:[int]",
          where the brackets indicate optional ints.
      {page_range_help}
      Note the difference between this notation and arguments to slice():
          slice(3) means the first three pages;
          PageRange("3") means the range of only the fourth page.
          However PageRange(slice(3)) means the first three pages.
      """
  </code></pre>
  
  <p>The error is receive is the following:
  <code>TypeError: "pages" must be a tuple of (start, stop[, step])</code></p>
  
  <pre><code>    Traceback (most recent call last):
  File "combining_select_pages_from_many_pdfs.py", line 112, in &lt;module&gt;
  main() 
  File "combining_select_pages_from_many_pdfs.py", line 104, in main
  newPdfFile = mergePdfFiles(l_PdfObjects)
  File "combining_select_pages_from_many_pdfs.py", line 63, in mergePdfFiles
  tempMergerFile.merge(position=fn_PdfObjects+1, fileobj=l_fn_PdfObjects[fn_PdfObjects],pages=[0])
  File "/home/sybie/.local/lib/python3.5/site-packages/PyPDF2/merger.py", line 143, in merge
  raise TypeError('"pages" must be a tuple of (start, stop[, step])')
  </code></pre>
  
  <p>What I can find about this is:</p>
  
  <pre><code># Find the range of pages to merge.
      if pages == None:
          pages = (0, pdfr.getNumPages())
      elif isinstance(pages, PageRange):
          pages = pages.indices(pdfr.getNumPages())
      elif not isinstance(pages, tuple):
          raise TypeError('"pages" must be a tuple of (start, stop[, step])')
  </code></pre>
  
  <p>src: <a href="https://github.com/mstamy2/PyPDF2/blob/master/PyPDF2/merger.py#L137" rel="nofollow">https://github.com/mstamy2/PyPDF2/blob/master/PyPDF2/merger.py#L137</a></p>
  
  <p>Thanks in advance for all the help!</p>