title: Slow instantiation of iTextSharp PdfReader with large fillable form
body: <p>I have a large (6 pages, 222 fields) fillable PDF that I am using as a template with iTextSharp PdfReader.  When this object instantiates it takes 5 minutes or more.  I have tried:</p>
  
  <pre><code>string pdfPath = Path.Combine(context.Server.MapPath("~/apps/ssgenpdf/App_Data"), "07-2011 Worksheets.pdf");
  reader = new PdfReader(pdfPath);
  </code></pre>
  
  <p>alternatively I have tried reading the file into a memory stream and passing the memory stream to the PdfReader constructor.  Additionally I have tried using:</p>
  
  <pre><code>reader = new PdfReader(new RandomAccessFileOrArray(pdfPath), null);
  </code></pre>
  
  <p>none of these alternatives show significant gains.</p>
  
  <p>This is an ASP.Net app, and so my interim solution is to do this creation on application start and caching the reader, then I check to see if I get a valid reader from the cache and instantiate a new reader from that reader.  Now I routinely see under 50 millisecond response from this approach.</p>
  
  <p>My concern is that this does not seem scalable if others in my group want to use this "fillable PDF as template with iTextSharp" strategy.  Does anyone have any suggestions for alternate strategies to balance performance with scalability?  </p>