Hi Team,
Hi Navaneethan,
//<o:p></o:p>
// Summary:
// Initialize new Document instance from the input stream.
//
// Parameters:
// input:
// Stream with pdf document.
public Document(Stream input);
//
// Summary:
// Just init Document using filename. The same as Aspose.Pdf.Document.#ctor(System.IO.Stream).
//
// Parameters:
// filename:
// The name of the pdf document file.
public Document(string filename);
Sample code snippet:
//create byte arrays to keep the contents of PDF files
byte[] buffer1 = File.ReadAllBytes("E:/data/HelloWorld.pdf");
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 XLS format
//doc.Save(myDir + "PDFtoExcel2007.xml", excelsave);
doc.Save(outputStream, excelsave);
//convert MemoryStream back to byte array
byte[] data = outputStream.ToArray();
//create a FileStream to save the output PDF file
FileStream output = new FileStream(myDir + "PDFtoExcel.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();
}
}
Please feel free to contact us for any further assistance.
Best Regards,