Are there any source code samples that show how to take a Word Document from a FileUpload control and save it to a folder on the server as a PDF without first saving the Word Doc?
Nevermind, got it…
string saveDir = @"\Uploads";
string appPath = Request.PhysicalApplicationPath;
string fileName = Server.HtmlEncode(fuFileUpload.FileName);
string savePath = appPath + saveDir + System.IO.Path.GetFileNameWithoutExtension(fileName).Trim();
Document doc = new Document(fuFileUpload.PostedFile.InputStream);
doc.Save(savePath + ".xml", SaveFormat.AsposePdf);
Pdf pdf = new Pdf();
pdf.BindXML(savePath + ".xml", null);
pdf.Save(savePath + ".pdf");
Hi
It is perfect that you have already found the solution. I just would like to tell that using the latest version of Aspose.Words you can convert Word document to PDF directly (without using Aspose.Pdf). Please see the following link for more information:
https://docs.aspose.com/words/net/convert-a-document-to-pdf/
Best regards.