Add Name and Value in PDF Document Properties \ Custom with Reportlab
<p>I am wondering if is possible to add new Names &amp; Values (new attributes) to the PDF Document Properties \ Custom (AKA Metadata).</p>

<p>I've been looking to the documentation but it seems they don't speak about it. Only the metadata Author, Keywords, etc inside Document Properties \ Description.</p>

<p>Thanks in advance.</p>

<p>It seems that this is not possible, I checked the source code which actually specifies the reason why:</p>

<blockquote>
  <p>PDF documents can have basic information embedded, viewable from
      File | Document Info in Acrobat Reader.  If this is wrong, you get
      Postscript errors while printing, even though it does not print.</p>
</blockquote>

<p><a href="https://bitbucket.org/rptlab/reportlab/src/d73ddcc5dba569ecc41770001c06d5ca9f447b7b/src/reportlab/pdfbase/pdfdoc.py?at=default&amp;fileviewer=file-view-default#pdfdoc.py-1525" rel="nofollow">Sourcecode</a></p>

<p>As printing is one of the main goals of a PDF document (and not being able to print them sucks) it therefor makes sense to protect these properties.</p>

<p>The only options that are available in the <code>PDFDocument</code> class are: <code>setTitle</code>, <code>setAuthor</code>, <code>setSubject</code>, <code>setCreator</code>, <code>setKeywords</code>, <code>setDateFormatter</code>. Most likely because these are the only one that are hard to get wrong.</p>

python reportlab