title: Xref table not zero-indexed. ID numbers for objects will be corrected. won't continue
body: <p>I am trying to open a pdf to get the number of pages. I am using PyPDF2.</p>
  <p>Here is my code:</p>
  <pre><code>def pdfPageReader(file_name):
      try:
          reader = PyPDF2.PdfReader(file_name, strict=True)
          number_of_pages = len(reader.pages)
          print(f&quot;{file_name} = {number_of_pages}&quot;)
          return number_of_pages
      except:
          return &quot;1&quot;
  </code></pre>
  <p>But then i run into this error:</p>
  <blockquote>
  <p>PdfReadWarning: Xref table not zero-indexed. ID numbers for objects will be corrected. [pdf.py:1736]</p>
  </blockquote>
  <p>I tried to use strict=True and strict=False, When it is True, it displays this message, and nothing, I waited for 30minutes, but nothing happened. When it is False, it just display nothing, and that's it, just do nothing, if I press <kbd>ctrl</kbd>+<kbd>c</kbd> on the terminal (cmd, windows 10) then it cancel that open and continues (I run this in a batch of pdf files). Only 1 in the batch got this problem.</p>
  <p>My questions are, how do I fix this, or how do I skip this, or how can I cancel this and move on with the other pdf files?</p>