hi need to show the xls/doc in the webpage i.e inside the webpage like IFRAME. user will give the path of the documents in the textbox above iframe. I am trying to convert the existing docs/xls into PDF using c# to get the doc from path given by user and need to show in iframe.
can you give me the code or free 3rd party tool to achieve this. kindly help bit urgent.
[email protected]
Loading

jiss j2 reputationPosted Jul 13, 2010, 1:59 AM EDT
Ivan Vasilyev10 reputationPosted Jun 11, 2014, 12:30 AM EDT
You can use with C# code a word automation functions to call the Document.ExportAsFixedFormat method and also with C# code an excel automation to call Workbook.ExportAsFixedFormat method.
If this is not an option for you (these interop libraries are not recommended on server side) then take a look at the following 3rd party tools that have a free version (free version has some file size limitations, but it is fully featured).
This one is a word processing component for C# and here is how you can use it to convert your Word documents into a PDF files in .NET:
string inputFilePath = "Document.doc";
string outputFilePath = "Document.pdf";
DocumentModel.Load(inputFilePath).Save(outputFilePath);
And this one is an excel processing component for C#, also here is how you would achieve the same, conversion of Excel files into a PDF format from C#:
string inputFilePath = "Spreadsheet.xls";
string outputFilePath = "Spreadsheet.pdf";
ExcelFile.Load(inputFilePath).Save(outputFilePath);
Bhabani PrasadRank #8,369 · 223 reputationPosted Jun 11, 2014, 12:46 AM EDT
Anupam SinghRank #643 · 3.7K reputationPosted Jun 11, 2014, 1:22 AM EDT
You can download library from sourceforge.net/projects/itextsharp/