title: Error PDF header signature not found
body: <p>After converting file from MSword to PDF extraction i am getting a error <em>PDF header signature not found.</em> </p>
  
  <pre><code>public void Extract_inputpdf()
  {
      text_input_File = string.Empty;
  
      StringBuilder sb_inputpdf = new StringBuilder();
      PdfReader reader_inputPdf = new PdfReader(path); //read PDF
      for (int i = 0; i &lt;=reader_inputPdf.NumberOfPages ; i++)
      {
          TextWithFont_inputPdf inputpdf = new TextWithFont_inputPdf();
  
          text_input_File = iTextSharp.text.pdf.parser.PdfTextExtractor.GetTextFromPage(reader_inputPdf, i, inputpdf);
  
          sb_inputpdf.Append(text_input_File);
  
          input_pdf = sb_inputpdf.ToString();
      }
  
      reader_inputPdf.Close();
      clear();
  }
  </code></pre>
  
  <p>can anyone tell me how to solve this.Thanku </p>
  
  <pre><code>// word to pdf
  if (Extentsion_path == ".doc" || Extentsion_path == ".docx")
  {
      uploadFInput.SaveAs(targetPathip);
      string wordFileName = targetPathip;
      _Word.Visible = false;
      _Word.ScreenUpdating = false;
  
      // Cast as Object for word Open method  
      filename = (object)wordFileName;
  
      // Use the dummy value as a placeholder for optional arguments  
  
      Microsoft.Office.Interop.Word.Document doc = _Word.Documents.Open(ref filename, ref _MissingValue,
          ref _MissingValue, ref _MissingValue, ref _MissingValue, ref _MissingValue, ref _MissingValue,
          ref _MissingValue, ref _MissingValue, ref _MissingValue, ref _MissingValue, ref _MissingValue,
          ref _MissingValue, ref _MissingValue, ref _MissingValue, ref _MissingValue);
      doc.Activate();
  
      object outputFileName = pdfFileName = Path.ChangeExtension(wordFileName, "pdf");
      object fileFormat = WdSaveFormat.wdFormatPDF;
  
      // Save document into PDF Format
      doc.SaveAs(ref outputFileName, ref fileFormat, ref _MissingValue, ref _MissingValue,
          ref _MissingValue, ref _MissingValue, ref _MissingValue, ref _MissingValue,
          ref _MissingValue, ref _MissingValue, ref _MissingValue, ref _MissingValue,
          ref _MissingValue, ref _MissingValue, ref _MissingValue, ref _MissingValue);
  
      // Close the Word document, but leave the Word application open.
      // doc has to be cast to type _Document so that it will find the
      // correct Close method.
      object saveChanges = WdSaveOptions.wdDoNotSaveChanges;
      ((_Document)doc).Close(ref saveChanges, ref _MissingValue, ref _MissingValue);
      doc = null;
  
      // word has to be cast to type _Application so that it will find
      // the correct Quit method.
      ((_Application)_Word).Quit(ref _MissingValue, ref _MissingValue, ref _MissingValue);
  
      _Word = null;
  
      //uploadFInput.SaveAs(pdfFileName);
      // = targetPathip;
      uploadFInput.SaveAs(pdfFileName);
      LblFleip.Text = pdfFileName;
  }
  else
  {
      uploadFInput.SaveAs(targetPathip);
      LblFleip.Text = targetPathip;
  }
  </code></pre>