title: Parse a PDF document with ruby
body: <p>I have multiple PDF documents in a folder that have a certain structure:</p>
  
  <p><img src="https://i.stack.imgur.com/Nno3I.png" alt="enter image description here"></p>
  
  <p>Now I want to be able to parse the information from the PDF. Please note that the paragraphs have varying lengths.</p>
  
  <p>Obviously I am not asking you to solve the problem for me, but I do need some pointers as to how this can be achieved.</p>
  
  <p>I have used nokogiri before and technically I need something like that but for PDFs.</p>
  
  <p>So the pseudo result for my example would look like this:</p>
  
  <pre><code>- ItemA
    - Title: ItemA
    - File: 123456789.pdf
    - Image: ImageA.png (the image was stored on disk)
    - Subtitle1: Content for subtitle 1
    - Subtitle2: Content for subtitle 2
    - Subtitle3: Content for subtitle 3
  - TitleB
    - [...]
  </code></pre>