title: Programmatically add comments to PDF header
body: <p>Has anyone had any success with adding additional information to a PDF file?</p>
  
  <p>We have an electronic medical record system which produces medical documents for our users.  In the past, those documents have been Print-To-File (.prn) files which we have fed to a system that displayed them as part of an enterprise medical record.</p>
  
  <p>Now the hospital's enterprise medical record vendor wants to receive the documents as PDF, but still wants all of the same information stored in the header.</p>
  
  <p>Honestly, we can't figure out how to put information into a PDF file that doesn't break the PDF file.</p>
  
  <p>Here is the start of one of our PDFs...      </p>
  
  <pre><code>%PDF-1.4  
  %âãÏÓ  
  6 0 obj  
  &lt;&lt;  
     /Type /XObject  
     /Subtype /Image  
     /BitsPerComponent 8  
     /Width 854  
     /Height 130  
     /ColorSpace /DeviceRGB  
     /Filter /DCTDecode  
     /Length 17734&gt;&gt;  
  stream  
  </code></pre>
  
  <p>In our PRN files, we would insert information like this:</p>
  
  <pre><code>%MRN% TEST000001
  %ACCT% TEST0000000000001
  %DATE% 01/01/2009^16:44
  %DOC_TYPE% Clinical
  %DOC_NUM% 192837475
  %DOC_VER% 1
  </code></pre>
  
  <p>My question is, can I insert this information into a PDF in a manner which allows the document server to perform post-processing, yet is NOT visible to the doctor who views the PDF?</p>
  
  <p>Thank you,</p>
  
  <p>David Walker</p>