Hi,
Hi Ashok,
//create file stream to read pdf file<o:p></o:p>
FileStream fs1 = new FileStream(myDir + "Job+Listing.pdf", FileMode.Open, FileAccess.Read);
//create byte array to keep the contents of PDF file
byte[] buffer1 = new byte[Convert.ToInt32(fs1.Length)];
fs1.Read(buffer1, 0, Convert.ToInt32(fs1.Length));
using (MemoryStream outputStream = new MemoryStream())
{
using (MemoryStream inputStream = new MemoryStream(buffer1))
{
// load PDF document
Aspose.Pdf.Document doc = new Aspose.Pdf.Document(inputStream);
// instantiate ExcelSave Option object
Aspose.Pdf.ExcelSaveOptions excelsave = new ExcelSaveOptions();
excelsave.UniformWorksheets = false;
// save the output in memory stream
doc.Save(outputStream, excelsave);
//convert MemoryStream back to byte array
byte[] data = outputStream.ToArray();
//create a FileStream to save the output xls file
FileStream output = new FileStream(myDir + "PDFtoExcelt.xls", FileMode.Create,
FileAccess.Write);
//write byte array contents in the output file stream
output.Write(data, 0, data.Length);
//close output file
output.Close();
}
}