Conversion of Excel file to pdf getting error
I am Converting Excel file (i.e 2003,2007,2010 and office 365) to pdf but i am geetting error like (System.Runtime.InteropServices.COMException (0x800A03EC): Exception from HRESULT: 0x800A03EC) or (Exception from HRESULT: 0x800A03EC) on windows server2012 R2. Docx , doc , pptx,ppt file successfully converted into pdf and i have install office 365 on the server (i.e windows server 2012 R2). Pleas help me out. i am getting stuck from last 4 to 5 days.
Gowtham RajamanickamPosted Apr 8, 2015, 12:31 AM
Jacky HanPosted Apr 7, 2015, 11:50 PM
// load Excel file
Workbook workbook = new Workbook();
workbook.LoadFromFile("D:\\test.xlsx");
// Set PDF template
PdfDocument pdfDocument = new PdfDocument();
pdfDocument.PageSettings.Orientation = PdfPageOrientation.Landscape; pdfDocument.PageSettings.Width = 970;
pdfDocument.PageSettings.Height = 850;
//Convert Excel to PDF using the template above
PdfConverter pdfConverter = new PdfConverter(workbook);
PdfConverterSettings settings = new PdfConverterSettings();
settings.TemplateDocument = pdfDocument;
pdfDocument = pdfConverter.Convert(settings);
// Save and preview PDF
pdfDocument.SaveToFile("sample.pdf");
Abhishek JaiswalPosted Mar 11, 2015, 10:15 AM
Did you check if it's a permission issue? It's possible that you are trying to save the file to a location and .NET doesn't have the permissions to write to that location. Meanwhile you can try this article
http://stackoverflow.com/questions/4408336/system-runtime-interopservices-comexception-0x800a03ec