Editing word documents in a web page - asp.net

I realise this question has been asked many times before but a lot of them are old now without an answer.
I have a need for users to be able to edit word documents from my web page.
Are there any editors, or components, that will allow me to do this?
A bit of background, the user will be able to upload a word document to my site and then view/edit it from there. There will be no requirement for the user to download the document again but ideally I'd like to keep the document as a word doc at my end.
Cheers

A little pricey, but the .NET Server version of TX Text Control allows editing of .doc and .docx documents within a browser. (I have the standalone .NET Pro version.)
Here's a much cheaper one: Cute Editor, but I have never used it.

Well, you can do what you want with the OpenXML SDK and some XSLT (you can convert to/from docx or WordML to html) but it's not easy, and you'd have a great deal of difficulty retaining fidelity if you have much more than very simple documents.

Related

Can I control the handling of word files by the user in asp.net?

Today we have a classic asp application to manipulate the word files in the company. By using ActiveX, we can download, edit, print and finally upload the modifications without much interation.
Explaining: If I need to update anything in the "Processes.doc" file, I click on it, the ActiveX download the file to my desktop, I use it whenever I want but, when I close the file, the ActiveX uploads the new version, if this need applies with the rules.
This feature only works under IE and the users have this desire to do the same in other browsers. And the boss wants this system updated in asp.net.
My question is only "how is this possible?" How can I make it cross-plataform with the same usability that I have now? I spent the day reading about custom controls in asp.net (using object tag, but it don't work in FF), third-party components (expensive and I don't know if it will work), ActiveX written in .NET.
Any other suggestions? There is another way to this?
ActiveX is being phased out as is Flash and being replaced by JS/HTML5. These two client side technologies are more than capable of editing word documents but in the end I think you'll find that getting away from a proprietary format like MS word is the way to go. HTML is powerful enough to provide most of the same features of MS word so once the files have been converted it's simply a matter of finding a javascript HTML document editor. From there you simply need to rework the mechanism which downloads and uploads the HTML to the server to use AJAX and you'll be good to go.
Here are some examples of HTML editors:
http://www.tinymce.com/
http://speckedit.com/demo
http://nicedit.com/demos.php
http://ckeditor.com/demo

How to preview an array of bytes which represents a file content in client browser?

We are in a need to interact with a Document Management Systems which saves file (mostly PDF & DOC & DOCX) as an array of bytes and saves also its file extension.
So, we need to build a file viewer which display files in client's browser.
We think of converting DOC files into PDF and preview converted file in browser, others think of converting array of bytes to HTML (this solution is a big question for us as we don't know how to do this and if this is available or not) and transfer rendered html.
But we don't think that these solutions are the best and cross browser solutions.
So, is there any way to do such functionality? which must be a cross browser solution?
The first question you have to answer is whether the users need to be able to edit the documents. If so, then your best "viewer" is going to be a the Word and Adobe client apps. Please note that in this case, you will also need to give the users the ability to upload (and possibly check-in) the edited documents.
If the users just need read access, then you can certainly just show them an image or PDF of the file in their browser. If you go the PDF route, you will save money using Adobe reader, but it will be a "clunkier" user experience.
If you want to give your users a read-only view, you will need to "render" .doc files into PDF's or TIFF's or PNG's or whatever. I don't recommend doing this in the browser unless ALL of your documents are VERY simple.
If you users require a single, web-based interface for all of their rendered .doc and .pdf files, then you may want to consider using an java or activex-based document viewing applet. Daeja is the most popular vendor for this type of viewer, and it even gives your users the ability to annotate documents.
One more note. Rendering .doc files can be a very expensive, cumbersome, and error-prone process. I've worked on numerous systems at multiple companies that have tried this, and no matter what we did or how much we spent, it never worked terribly well.
Good luck!
Tom Purl

.net component for previewing office documents

I have a CMS system written in ASP.NET which among other things allows users to upload documents, typically PDF, powerpoint, Word etc.
I am investigating how to implement a preview function so that once the document has been uploaded it would generate a thumbnail of the first page in the document.
Does someone have an idea what libraries, controls are available to achieve this?
I ended up using Adeptol AJAX DocumentViewer. Very easy to implement and works with over 300 formats.

Software design question - uploading Word docs or using markdown?

I've got an asp website that currently has students copying and pasting from Word into a textarea and submitting a paper that way. In this case, they can't do any formatting.
Instructors pull up the students' work and apply html spans and styles to it as commentary.
We've thought about going to a system where the student uploads a Word doc and the instructor makes comments within the doc and uploads it back for the student to view.
Would it make more sense to keep the system as a paste operation and maybe provide some markdown or rich text controls? I'm wondering about compatibility/virus/formatting/size issues with Word making it difficult to upload/download/store.
Yeah - this is a design question.. ;)
As a users I can tell you that it's easier to have Word upload feature. Copy and paste is a little of trouble and users tend to want it the easy ways.
On the other side, instructors are also your users, so what I would do for the instructors is create web-based application that parse out Word document to a WYSIWYG rich text editor for editing or make commentary. In addition, instructors also have option to download the Word document and edit them on local computer and upload it back to your application.
It's a little of work but I am sure both users (students and instructors) would like it. You can start by working on students' Word upload feature and move on to insturctors'.
If you worry about formatting and compatibility of Word, from my experience, if the code parse the Word document right you should not have formatting and compatibility issues.

ASP.NET website, server-side DOCX to PDF conversion

I've been having a heckuva time with this problem, and there seems to be a lot of noise out there in search engines in getting to the bottom of it, so forgive me if I've missed a silver bullet out there.
The base need is that I have to generate a PDF document that has both static and dynamic elements. I started to do this by having a PDF template with all the static content, and then I wanted to inject various dynamic elements into it. The problem is that PDFs are not meant to be manipulated that way, and depending on the size of the dynamic text I put in there, might overflow text on other pages. I was using iTextSharp but can't get past this problem.
A possible fallback is to generate a DOCX, which I've done before, and then convert it into a PDF on the backend. The only libraries I've found to do this are paid apps (like Aspose). There are examples out there that convert to PDF without these libraries, but they seem to require a client-side application. I'm doing this via IIS.
To make a long story longer...are there free libraries that will convert a DOCX file to a PDF server-side without launching client applications to do so?
There are a few choices here:
build a COM interop class that will perform read and 'Save As' functions on your .docx. The MSDN link you gave doesn't require to be run client-side, but rather have the Office assemblies in the GAC or in your ASP.NET's bin directory.
buy a third party component to do the work for you. Here's just one example with no guarantees.
I'm not familiar with any good free ones, but we used Aspose.Words to achieve something similar to what you describe. We keep Word templates with static text and mail-merge fields. The templates can be regular Word documents, they don't have to be .dot templates. Mail-merge fields can be either single fields or repeatable data in tables so you can easily generate pretty complex documents without doing dynamic document editing. (Which is always an option)
Using Aspose for this was so friction free that I would suggest using Aspose unless the cost (which is significant) is a show-stopper. The support is also good which is always an added bonus.
There are always some caveats...
I would have liked more control over the PDF compatability of the generated PDFs. We had some issues with older clients reading the generated PDFs.
Mail-merge is not fun. Complex mail-merge expressions was time consuming to get right.
I just found very simple solution to convert any files from command-line using LibreOffice:
soffice.exe --headless --convert-to pdf file.xls
(google for the rest)

Resources