Click here to Skip to main content
15,888,401 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hello friends,


please give the solutions for this error.
Application threw an exception: Failed to invoke member "ExportAsFixedFormat"--The export failed due to an unexpected error.

[Urgent For you not for us]

code:
C#
using WebSupergoo.ABCpdf8;
using WebSupergoo.ABCpdf8.Atoms;
using WebSupergoo.ABCpdf8.Internal;
using WebSupergoo.ABCpdf8.Objects;
using WebSupergoo.ABCpdf8.Operations;
using System.Drawing;


C#
public void ConvertWordtoPdf()
{
    Doc objDoc = new Doc();
        objDoc.Read("D:\\User\\Keerthana\\test1.docx");
        objDoc.Save("D:\\User\\Keerthana\\Projects\\PDF\\WordDocumentToPdf.pdf");
        objDoc.Clear();
        objDoc.Dispose();
       
        
    }

//other method
C#
public void ConvertWordtoPdf()
    {


Doc objDoc = new Doc();
XReadOptions xr = new XReadOptions();
xr.ReadModule = ReadModuleType.MSOffice;
objDoc.Read("D:\\User\\Keerthana\\test1.docx", xr);//this place I got the exception(Application threw an exception: Failed to invoke member "ExportAsFixedFormat"--The export failed due to an unexpected error.)
objDoc.Save("D:\\User\\Keerthana\\Projects\\PDF\\WordDocumentToPdftest.pdf");
objDoc.Clear();
xr.Dispose();
objDoc.Dispose();
objDoc = null;
}

public void ConvertPPTtoPdf()
{
Doc theDoc=new Doc();
//string pathPPT = "D:/User/Keerthana/DSSI_PPT.pptx";
//theDoc.Read(pathPPT);
theDoc.Read("D:\\User\\Keerthana\\DSSI_PPT.pptx");//exception(Application threw an exception: Failed to invoke member "SaveAs"--Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL)).
)
theDoc.Save("D:\\User\\Keerthana\\Projects\\PDF\\test34.pdf");
theDoc.Clear();
theDoc.Dispose();
}
public void ConvertExceltoPdf()
{

Doc theDoc = new Doc();
theDoc.Read("D:\\User\\Keerthana\\Book1.xlsx");
theDoc.Save("D:\\User\\Keerthana\\Projects\\PDF\\ExcelToPdfDocument.pdf");
theDoc.Clear();
theDoc.Dispose();
}


exception


Application threw an exception: Failed to invoke member "SaveAs"--Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL)).



please any one can help me. I waiting for your reply
Posted
Updated 26-Aug-13 17:42pm
v8
Comments
[no name] 26-Aug-13 7:39am    
No it's not urgent for us either
CPallini 26-Aug-13 7:46am    
How can we help without detailed info (code, with pointers to the line where it happens)?
_Amy 26-Aug-13 7:53am    
Where is the code block? Can I see that?
If you are getting any exception in your code, you should paste the code together with the question. Please click on Improve question and provide the code snippet.

Consult here:

http://www.codeproject.com/Questions/643240/convert-word-document-to-pdf-using-abc-pdf-in-dot


Or it may be a security rights issue. Consult here:
http://sqlreporting.blogspot.com/2010/11/office-automation-configuraiton-on.html
 
Share this answer
 
v2
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900