Is it possible to convert a URL to docx in aspose for word in java ?
The URL will be mostly a angular js application URL
Yes. handle the request by creating the Word document using Aspose, server-side, and save the docx to a nested folder. Then return the URL of the docx in the response. This will download the docx to the user’s desktop (using IE).
can you share the code snippet for converting URL to docx. ?
Thanks
spencer
Hi Spencer,
Thanks for your inquiry. You can load the document via URI. Please check the following code example. Hope this helps you.
Document doc = new Document(@"http://www.aspose.com/products/total/net");
doc.Save(MyDir + "Out v16.7.0.docx");
This code snippet is not working .
I am getting this error
Aug 30, 2016 12:14:30 PM java.util.prefs.WindowsPreferences
WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(…) returned error code 5.
My code.
import com.aspose.words.Document;
public class AsposeTest {
public static void main(String[] args) throws Exception {
Document doc = new Document("https://app.revature.com");
doc.save("E:\Outv3456.docx");
}
}
When I run this code the document is getting generated but there is no content in that.
Hi Spencer,
Thanks for your inquiry.
spencer.bharath:
The URL will be mostly a angular js application URL
AngularJS is a complete JavaScript-based web application framework. I am afraid, Aspose.Words does not deal with JavaScript and no JavaScript is read or written during open and save. Please read the features supported on HTML import from following link.