12 Answers, 1 is accepted
You can import Word documents using the LoadDocxContent() method for DOCX content and LoadRtfContent() for RTF.
These methods can be used with different overloads to best fit the application scenario:
LoadDocxContent(Stream docxStream)—loads DOCX content from a Stream.
LoadDocxContent(string docxText)—loads DOCX content from an ASCII-encoded String.
LoadRtfContent(Stream rtfStream)—loads RTF content from a Stream.
LoadRtfContent(string rtfText)—loads RTF content from an ASCII-encoded String.
For more information check this article Importing from Word document.
The MS Word like experience of RadEditor is demonstrated in the following demo: MS Word-like Experience.
The features like Bold, Italic, Underline, Strikethrough, Fore and Back Color, Insert Image, Insert Hyperlink and Insert Table are supported in the editor and in the exported DOCX file.
The Track Changes and Comments features are supported only inside RadEditor and will not persist in the exported DOCX file.
The SaveAsDocX command executes the __doPostBack method to initiate a postback and on the server to call the ExportToDocx server method.
You can see how the SaveAsDocX command is implemented in the scripts.js file available with the demo installation as well as in the source code tab of the online demo:
The Open option comes from the content-disposition=attachment HTTP header when the file comes from the server. With client-side export, it is up to the browser to decide what options to provide.
What you can do is:
- check the Save Exported Files article which can help you to save the exported file on the server
- look into using the OnExportContent to get the file RadEditor provides so you can change it. See this article for details.
- look into using a different HTML->PDF conversion tool as explained in this section of the documentation. It also links a blog post that shows how you can use the Telerik Document Processing Library for this.
I have referred the Save Exported Files article and used the Page Method. The "storeFile(string base64)" method is not storing any file data in the mentioned file path, but "OnSucceeded(data)" is being called and the data is getting prompted as an alert.
And, I believe the given code should work only for PDF, but I want to store the file as a word document. What are the possible changes to be made for storing as word document? Kindly help me on this.
"public static string storeFile(string base64)" - This method is not at all invoking when initiate the call from "function callMyPageMethod(arg)" method. Is any other configuration have to be done to make this call? We are completely blocked to move forward on this implementation, can you please help us?
You can easily save the docx file to the server using this approach:
You can find attached a sample project attached to my reply.
I am able to export external images to word but on using the Image Manager to export images to word document it is throwing System.net.web exception at
byte docxBinaryData = docxProvider.Export(flowDocument);
Kindly help me on this.
I'm glad the sample provided by my colleague Rumen has proven helpful in saving the document. As for the remaining requirements, I suggest that you open a formal support ticket and send us the modified ExportToDocx.zip sample to demonstrate the specific issue so we can continue providing assistance on this case.