title: itextSharp PDF to text file in c# issue in Amazon EC2 instance
body: <p>I've a very strange issue and might be I'm not sure whats happen in the Amazon EC2 Instance.</p>
  
  <p>I'm loading the PDF and extract the data and return the output as string using iTextsharp component(version 5.4.1). Its absolutely working fine in my local machine.</p>
  
  <p>But when I deployed into Amazon EC2 instance (windows server 2008 R2) and its not working and getting error. I've captured the error in log file as below</p>
  
  <pre><code>java.io.IOException: Error: End-of-File, expected line
  iTextSharp.text.exceptions.InvalidPdfException: PDF header signature not found
  </code></pre>
  
  <p>My code was below and any help/suggestions would be really appreciated. </p>
  
  <pre><code>public static string parseUsingPDFBox(string PDFFilePath)
  {
         PdfReader reader = new PdfReader(PDFFilePath);
         StringWriter output = new StringWriter();
  
         for (int i = 1; i &lt;= reader.NumberOfPages; i++)
              output.WriteLine(PdfTextExtractor.GetTextFromPage(reader, i, new SimpleTextExtractionStrategy()));
  
         reader.Dispose();
         return output.ToString();
  }
  </code></pre>
  
  <p>I've all admin rights for EC2 instance and using .Net framework 4.0</p>