title: How can I extract the TOC with PyPDF2?
body: <p>Take <a href="https://arxiv.org/pdf/1707.09725.pdf" rel="nofollow noreferrer">this pdf</a> as an example. I can extrac the table of contents (TOC) with <code>dumppdf.py -T 1707.09725.pdf</code>:</p>
  
  <pre><code>&lt;outlines&gt;
      &lt;outline level="1" title="1 Introduction"&gt;
          &lt;dest&gt;
              &lt;list size="5"&gt;
                  &lt;ref id="513"/&gt;
                  &lt;literal&gt;XYZ&lt;/literal&gt;
                  &lt;number&gt;99.213&lt;/number&gt;
                  &lt;number&gt;742.911&lt;/number&gt;
                  &lt;null/&gt;
              &lt;/list&gt;
          &lt;/dest&gt;
          &lt;pageno&gt;14&lt;/pageno&gt;
      &lt;/outline&gt;
      &lt;outline level="1" title="2 Convolutional Neural Networks"&gt;
          &lt;dest&gt;
              &lt;list size="5"&gt;
                  &lt;ref id="554"/&gt;
                  &lt;literal&gt;XYZ&lt;/literal&gt;
                  &lt;number&gt;99.213&lt;/number&gt;
                  &lt;number&gt;742.911&lt;/number&gt;
                  &lt;null/&gt;
              &lt;/list&gt;
          &lt;/dest&gt;
          &lt;pageno&gt;16&lt;/pageno&gt;
      &lt;/outline&gt;
  ...
  </code></pre>
  
  <p>Can I do something similar with PyPDF2?</p>