Is it possible to convert an existing word document that resides on the Web Server into a PDF file using ASPOSE.PDF? Do you have a sample ASP.NET example that would take a Word Document and convert it to a PDF doc on the server? I couldn’t find any examples but saw an old reference in the Forums that it was a work in progress. Is it available?<?xml:namespace prefix = o ns = "urnchemas-microsoft-comfficeffice" /><o></o>
The example that you directed me to is below. I put it in a button click event to test it. It does not work. The error message is included as comments. Also the example produces a warning message…
Could you please take a look at what is published is correct or requires updating. If not, do you have an example that simply takes an existing Word document and converts it to a PDF format.
My confidence about buying a suite of products is shaken when a simple demo dosen’t work. Please help.
… using Aspose.PDF; using Aspose.Word; … private void Button1_Click(object sender, System.EventArgs e)
{
Word word = new Word();
Document doc = word.Open(@“C:\Temp\WordOutput.doc”); //<-- warning message states that this is obsolete
//Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Thank you for the support. I’m really impressed with the speed of the conversion. I am using the following VB code that uses a memory stream rather than an intermediate file so it could run as a WS. Would I run into problems if I use encoding.ASCII in the loadXML statement?
Also, I tested with Word document that had a colored background and highlighted text. It did not convert. Is this because I am using the demo version of 1.9.2
Thanks for the support.
Dave
Dim InPath As String = inUNC.Trim
Dim OutPath As String = outUNC.Trim
Dim mStreamXML As MemoryStream = New MemoryStream
Dim xmlDoc As System.Xml.XmlDocument = New System.Xml.XmlDocument
Dim objDocument As WORD.Document = New WORD.Document(InPath)
LoadXml is a .NET method and you can look at it’s documentation. I think using Encoding.ASCII will not cause problem is you don’t use unicode.
The evaluation version of Aspose.Pdf has full features. Some advanced features in Word is not supported in Aspose.Pdf. But colored background should be supported. You can send me the Word document if it has problem to convert to PDF.
I have no example of converting database stored word document to pdf document. But I think there is no difference if you can open the word document in database using Aspose.Word.
I am not familiar with rich text control in Asp.Net and can’t give you any advice.