Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Fri Oct 30, 2015 3:41 pm

hi, i just downloaded spire.doc pro, using vs 2012 try to convert attacched pdf file i get "The file format cannot be supported."

this is the code:

Document document = new Document();
document.LoadFromFile("c:\fattura.pdf",FileFormat.PDF);
document.SaveToFile("c:\fattura.rtf", FileFormat.Rtf);

Thanks in advance.

fabriziodb
 
Posts: 1
Joined: Fri Oct 30, 2015 10:56 am

Mon Nov 02, 2015 5:45 am

Hello,

Spire.Doc only loads the Word documents, it can't load the PDF documents. And sorry that at present there are no any products support to convert PDF to RTF directly. And you can use our Spire.Office to firstly convert pdf to doc, and then convert the doc to rtf, but there is some format issues exist I have posted to our Dev team. Here is the code for your reference.
Pdf to Doc:
Code: Select all
PdfDocument pdfdoc = new PdfDocument();
pdfdoc.LoadFromFile( filename);
pdfdoc.SaveToFile(resultName, FileFormat.DOC);

Doc to rtf:
Code: Select all
Document doc = new Document();
doc.LoadFromFile(filename);
doc.SaveToFile(resultname, Spire.Doc.FileFormat.Rtf);


Sincerely,
Gary
E-iceblue support team
User avatar

Gary.zhang
 
Posts: 1380
Joined: Thu Apr 04, 2013 1:30 am

Return to Spire.Doc