title: Adding metadata to PDF
body: <p>I need to add metadata to a PDF which I am creating using <a href="http://rubygems.org/gems/prawn" rel="noreferrer">prawn</a>.  That meta-data will be extracted later by, probably, <a href="http://rubygems.org/gems/pdf-reader" rel="noreferrer">pdf-reader</a>.  This metadata will contain internal document numbers and other information needed by downstream tools.</p>
  
  <p>It would be convenient to associate meta-data with each page of the PDF.  <a href="http://wwwimages.adobe.com/www.adobe.com/content/dam/Adobe/en/devnet/pdf/pdfs/PDF32000_2008.pdf" rel="noreferrer">The PDF specification</a> claims that I can store per-page private data in a "Page-Piece Dictionary".  Section 14.5 states:</p>
  
  <blockquote>
    <p>A page-piece dictionary (PDF 1.3) may be used to hold private
    conforming product data. The data may be associated with a page or
    form XObject by means of the optional PieceInfo entry in the page
    object (see Table 30) or form dictionary (see Table 95). Beginning
    with PDF 1.4, private data may also be associated with the PDF
    document by means of the PieceInfo entry in the document catalogue
    (see Table 28).</p>
  </blockquote>
  
  <p>How can I set a "page-piece dictionary" with prawn?  I'm using prawn 0.12.0.</p>
  
  <p>If that's not possible, how else can I achieve my goal of storing metadata about each page, either at the page level, or at the document level?</p>