Convert .doc to pdf

Technical support for Spire.Doc

Moderator: iceblue support

Convert .doc to pdf

Postby Qvision » Wed Nov 30, 2011 8:27 am

I am evaluating your component for our company. We need a component that can convert .doc to .pdf on a webserver.

I tried the following code:

Dim path As String = "c:\test.doc"
Dim doc As New Spire.Doc.Document
doc.LoadFromFile(path, FileFormat.Doc)
doc.SaveToFile("test.pdf", FileFormat.PDF)

When i call the LoadFromFile function the following exception is raised:
NotImplementedExecption: Complex file cannot be supported

Why is this file not supported?
http://download.qvision.nl/test.doc
Qvision
 
Posts: 3
Joined: Tue Nov 29, 2011 3:34 pm

Re: Convert .doc to pdf

Postby Tina.Lin » Thu Dec 01, 2011 7:27 am

Hello Qvision,

Sorry for late reply.

I have tested your file without any problems. I attched the pdf file to you.
Here is the code:
Code: Select all
'Create word document
         Dim path As String=Server.MapPath(".\test.doc")
         Dim document As New Document()
         document.LoadFromFile(path)

         Dim section As Section = document.AddSection()
         section.AddParagraph().AppendText("Doc to PDF By Spire.Doc")

         'Save doc file tp pdf
         document.SaveToFile("Sample.pdf", FileFormat.PDF, Response, HttpContentType.Attachment)


If you still have any other questions, please don't hesitate to contact us.

Have a nice day.
You do not have the required permissions to view the files attached to this post.
Tina
Technical Support/Developer,
e-iceblue Support Team
User avatar
Tina.Lin
 
Posts: 152
Joined: Tue Sep 13, 2011 5:37 am

Re: Convert .doc to pdf

Postby Qvision » Thu Dec 01, 2011 10:43 pm

I have tried to run your code, but it still gives the same message.
Maybe it has something to do with de evaluation license?

Can you test your code with the dll's downloaded for evaluation purposes?

These are the librairies i used to test your product.
http://download.qvision.nl/Spire.Doc.zip

Hope to hear from you soon.
Qvision
 
Posts: 3
Joined: Tue Nov 29, 2011 3:34 pm

Re: Convert .doc to pdf

Postby Tina.Lin » Fri Dec 02, 2011 1:30 am

Hello Qvision,

I have tried the .dll you sent without any problems. May be it is affacted by your running environment.

Sorry for the inconvenience caused by us.
Have a nice day.
Tina
Technical Support/Developer,
e-iceblue Support Team
User avatar
Tina.Lin
 
Posts: 152
Joined: Tue Sep 13, 2011 5:37 am

Re: Convert .doc to pdf

Postby Qvision » Fri Dec 02, 2011 8:25 am

I tried it with . .net 2.0 library and a simple document works fine but when it becomes more complex the same message occurs again.
We will have to find a component that can convert more complex word documents.

Thanks for the support.
Qvision
 
Posts: 3
Joined: Tue Nov 29, 2011 3:34 pm


Return to Spire.Doc

Who is online

Users browsing this forum: No registered users and 0 guests

cron