Hi Aspose,
Hi,
Thank you for your interest in our products.
Of course you can use Aspose.Words for .Net with SharePoint. Could you please show your code or provide more details about what did not work when converting a document from a SharePoint document library?
If you are primarily interested in document conversion, you can consider using Aspose.Words for SharePoint and other products from our SharePoint family. For example, Aspose.Words for SharePoint can convert SPFile or SPFolder object and save the result directly to a SharePoint document library.
SPWeb web = SPContext.Current.Web;
SPFile srcFile = web.GetFile("Shared Documents/sample.docx");
// Convert to RTF with default options.
ConvertedItem result =
Converter.ConvertFile(srcFile, srcFile.ParentFolder, SaveFormat.Pdf, null);
Please note that Aspose.Words for SharePoint and Aspose.Words for .Net are different products. Aspose.Words for SharePoint does not provide an API for changing a document programmatically via document object model.
Thanks & Best Regards,
Hi,
Thank you for the additional information.
I see that you call Aspose.Words.Document constructor on a stream. If the data in the stream is correct, Aspose.Words creates a document object. It does not matter if the data came from SharePoint or other source.
Your code for getting the stream data looks correct to me. I tried it and it works, with this line:
request.Credentials = new NetworkCredential(username, password);
Without this line or if the password is incorrect, I get System.WebException saying “The remote server returned an error: (401) Unauthorized.” Please check that you provide a valid user name and password.
If the problem persists, please post the exception and error message you get.
Thanks & Best Regards,
Hello
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
Thanks for your interest in Aspose.Words. You can try using the following code to convert your HTML to PDF:
// Load HTML document
Document doc = new Document("C:\\Temp\\Test.html");
// Save as PDF
doc.Save("C:\\Temp\\Test.pdf", SaveFormat.Pdf);
In additional, please follow the link to see the table which provides implementation details about how Aspose.Words saves a document in the PDF format.
Best regards,
Hello
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
Thanks for your inquiry. You can find an approximate list of what is supported in HTML import/export here:
http://www.aspose.com/documentation/.net-components/aspose.words-for-.net/save-in-the-html-format.html
Regarding WSP, my colleague from developer team will take a look and answer you shortly.
Best regards,
Hi,
System.Net.HttpWebRequest works under SharePoint as well.
However, if you use it to get a file from the SharePoint server where you deploy your solution, this may not be the best option. You may consider using SharePoint object model to get the file data. Like this:
using Microsoft.SharePoint;
…
public void Test()
{
const string relativeFileUrl = @"Shared Documents\sample.docx";
SPFile file = SPContext.Current.Web.GetFile(relativeFileUrl);
using (Stream fileStream = file.OpenBinaryStream())
{
// Here you can use file data from the stream.
}
}
In this case, you will use the security context of the current user’s session.
Hope this helps. If you need further assistance, please provide more information on the error you get.
Thanks & Best Regards,