Viewing Word Documents inside Browsers - excel

I'm searching for some kind of Programm / Java Applet / ActiveX Control or magic spell to view Word / Excel Documents inside Browsers (Browser independent would be the best case, but IE only ist just fine).
I don't want to open Word itsself inside a frame, because that gives users the false impression that they can edit and save the document i just want to display its contents.
I also found solutions which converts the word document to pdf first, but i can't do this due to some security restrictions on the environment i'm working on.

This can help when those proprietary file formats can first be converted to ODF (for example by LibreOffice/OpenOffice.org): http://webodf.org/
(I will not comment on "security restrictions" and using Microsoft software ...)

Related

How to embed MS Word into a XPages

Is it possible to embed somehow MS Word object in XPages? I would like to use MS word as preview at the same XPages. There will be some filed then What I enter into field will update MS Word just like you see preview in MS Word before what you would like to print
I just wonder even if it is possible or not? Any ideas will be appreciated.
It's unlikely this will be specific to XPages. My golden rule on "how do I do x in XPages" is search "how do I do x on the web" and go from there. This StackOverflow question is as good a starting point as any. How to embed a document in HTML page?
You are probably entering a world of hurt down that road.
The old options:
OLE embedding was Internet explorer only (not Chrome, Firefox, Safari or Edge) and Windows only. Required Office on the workstation and is typically disabled for security (nothing of that has to do with XPages as backend).
Word to Html (requires word or OpenOffice on the server) is a Pita.
Your mobile users will not be happy or the MAC folks. Try to stick to a HTML editor and render that part.
But if you have to:
Poi4Xpages allows rendering of MS office documents from XPages app (one way output)
WebDAV for Domino allows round-trip editing of attachments in Domino
Skip the Word part and render directly to PDF - at least you get print fidelity. There's a series on that
POI4XPages will allow you to send Domino data to bookmarks in Word. From there users can download the Word doc or you can output to pdf.

Disable copy function in PDFTRON for Android

Is it possible to disable the copy option of the lib when selecting a text in the PDF using the PDFTron lib for Android?
I tried to search for the string, but also have not found it.
If you are using one of the mobile SDK's, or using our PDFViewWPF control for .Net 4+, then this is possible by modifying the tools code that is provided. There will one or two text selection tools, for which you can just comment out. Plus you would want to disable ctrl-c, and right click and select copy abilities. Exact code changes depends on platform. If you are using our older C++ PDFViewCtrl class this is harder to do, but I suspect you are not on this anyway.
Be aware though, there is no real way to prevent a user from extracting text from a PDF, since they can always open it in another PDF viewer and do it there.
See this form post for more info, including how to scramble the unicode values of text.
https://groups.google.com/forum/#!searchin/pdfnet-sdk/disable$20text/pdfnet-sdk/luWQmyhRDTw/z7UIGuu9uYkJ
Note, you will probably be interested in the PDFTron WebViewer technology, which provides much greater control over content. In particular, the original PDF file is never exposed to anyone for download. You can also encrypt the XOD file, so it cannot be opened in an XPS viewer, and you have full control over the UI, including disabling text search/extraction.
https://www.pdftron.com/webviewer/showcase/
https://www.pdftron.com/webviewer/index.html

Manipulating text of a document while it's open

Is it possible to extract, modify or simply read text in an Office while user types in words? It it possible through OpenXML SDK & InterOp library?
Thanks.
I have used the Microsoft Office Interop API for Word in a couple of projects, and surely, you can access the content of the document, even while a user is editing it.
I suggest you take a look at some tutorials to get you started, and if you encounter some problems, you can always return and ask.
Beware though - if you are expecting to be able to read the content each time a new character or word has been entered in the document, you might get disappointed, as there currently are no events raised when this happens. See this related question/answer for further details on this: Capturing keydown event of MS Word using C#

MFC Application in VC++

I have developed a desktop application using MFC, which has FILE, EDIT, VIEW and HELP options,along with one pen to write on the opened document which saves as test1. It is allowing me to open only test1 or test2 etc. Apart from these types of files, if i want to open PPTs or PDFs how can i do it?
The code to open a file is autogenerated by Visual Studio 2008. Now i need to modify the same.
This is something Microsoft doesn't provide any Wizards to do (at least not directly). The basic idea is that you have to create and add new document and view classes for the new file types. Then you need to add document strings to the string table to describe the association between the file extensions and the document/view classes. Then you register each document/view pair in the app class using the strings you added to the string table.
By far the easiest way to do this is to generate the document, view, and string in another (otherwise throwaway) application, grab the document, view, registration string and registration code from that application and put them into your application. Then generate another throwaway application for the next file extension.
That gives you a skeleton doc/view for each file extension. From there, it's up to you to write the code to actually open, display, edit, save, etc., that type of file. That's not going to be trivial for either PDF or (especially) PPT -- unless you "delegate" and use something like an ActiveX control to do the real work. If you want to do that, the Adobe ActiveX control works reasonably well (somewhat limited capabilities, but it'll show up essentially the same as a PDF in a web browser). Offhand I don't remember whether MS provides an ActiveX control for viewing PPT files. There is a free PPT viewer, but if memory serves it's an executable, rather than a control.

Can you do complex editing of Word Documents in a browser?

A friend of mine wants to have an application where people can upload documents in Word (or text) format, and then allow people to make edits to those documents within a browser.
Is there any mechanism that would support adding text "bubbles" for adding comments? Either floating, or off to the side.
Being able to save back to Word format is a must too. Or at least, some format supported by Word, that would still be editable. Saving it as an image is not acceptable.
I was thinking about opening the Word Document in an FCK Editor window, but FCK only seems to have "normal" inline text editing capabilities (although it is great).
Is this feasible?
Yes it is feasible. Google has done that (and it does have comments). So has Adobe. I'm sure there is more.
Xopus provides a programmable platform that allows you to define editable XML within a WYSIWYG environment. You could use it to define what you want to edit (XML), against which rules you want to edit it (an XSD) and how you want it to look while you edit it (XSL). Then you tie that all together with the Javascript API.
In other words, you could pretty easily define a document that contains multiple paragraphs with optional comments and then have them displayed as bubbles exactly the way you want them; when saved, a script on the server could be executed that converts the XML to a Word document.
Take a look at the demos.
If they are Word 2007 documents, you can use Silverlight. Here's an example application that uses Silverlight to open a Word 2007 document and display it in the browser.
Since StackOverflow is a programmer site, I'll assume you're a programmer. You can use Silverlight to add the bubbles and annotations to a Word 2007 document, but you'll need to know VB.NET or C#.
Take a look at docx2web.appspot.com which is (currently) a very bare bones editor with the distinguishing feature that the browser is directly manipulating (more or less) the "flat OPC" version of the docx.
This means that there is no lossy conversion on either the way in or the way out. So for example, when you save after editing, anything which was in the original docx is round tripped back to Word.
As far as support for older .doc is concerned, POI can be used to convert them to .docx (although your mileage may vary).
Why are you trying to compete with google docs?
I know that TinyMCE provides some rich controls for in browser editing. Last time i looked at it, it had 100% of the stuff i would normally use in word, and then some. On the other hand, i probably has 1% of the features that MS word provides. It would be VERY difficult to implement it all.
As far as saving to MS word compatible format. i am sure its possible. it would probably be easier to save to a non-doc format.
As far as popups etc, those can be easy built using jquery UI or any other javascript framework.
Bottom line: yes, its possible, but why?!
It is possible. For example eyeOS has a text processing application able to open and process Microsoft Office and OpenOffice.org text documents.

Resources