I’m using Aspose.Words 9.1 and the net3.5_ClientProfile DLLs.
When I try to save I’m not able to give it 4 arguments like the documentation says (below)
Hello
Thank you for reporting this problem to us. I managed to reproduce the problem on my side. Your request has been linked to the appropriate issue. You will be notified as soon as it is fixed.
As a workaround of this problem, please try using the following code:
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.Write("Hello world!!!");
MemoryStream stream = new MemoryStream();
doc.Save(stream, SaveFormat.Doc);
Response.Clear();
// Specify the document type.
Response.ContentType = "application/plain";
// Other options:
// Response.ContentType = "text/pdf"
// Response.ContentType = "text/html"
// Specify how the document is sent to the browser.
// Response.AddHeader("content-disposition","inline; filename=MyDocument.pdf");
// Another option could be:
Response.AddHeader("content-disposition", "attachment; filename=out.doc");
// Get data bytes from the stream and send it to the response.
byte[] bytes = stream.GetBuffer();
Response.BinaryWrite(bytes);
Response.End();
.NET 3.5 Client Profile excludes System.Web and therefore HttpResponse is not available. This is entirely by design. Use the Aspose.Words.dll for full .NET 3.5.
Thanks for your request. ASP.NET applications work under .NET 1.1 or .NET 2.0. To make sure, please check IIS settings. As you can see you can select only .NET 1.1 or .NET 2.0 (see the attached screenshot).
In your case, you should use Aspose.Words for .NET 2.0 in your ASP net application. In this case you can use code like the following:
I am upgrading an application and have run into the same errors: “SaveType is not a member of Words” and “SaveType is not a member of Cells.” This led me to this thread, but I am confused as to whether or not there is a working solution. I am getting the same errors whether I use the .net 2.0 dll or the .net 3.5 dll (Words 9.4.0).
How do I cause a Words-created document to open in Word on the client (the way it used to)?
Thanks for your help!
I have this issue where where doc.Save() only takes two arguments. I don’t understand this post:
romank: .NET 3.5 Client Profile excludes System.Web and therefore HttpResponse is not available. This is entirely by design. Use the Aspose.Words.dll for full .NET 3.5.
Thanks for your request. One of the Aspose.Words’ Document.Save overloads allows to save to a System.Web.HttpResponse object. This useful method sends a document to the client browser. But System.Web is not available in the .NET Framework 3.5/4.0 Client Profile so it was not possible to use Aspose.Words to target the Client Profile.
In your case, you should use Aspose.Words for .NET 2.0 in your ASP net application.
Best regards,