What are possible ways to read and display .docx/.doc file in editable mode - google-chrome

Using HTML5 File API I am able to read text and XML files without any problems. I have tried to read the .docx/.doc file with the same code and that was not working. In my chrome extension I need to open a .doc/.docx file in editable mode in Google chrome. I am really waiting to know all the possible ways to achieve this. I found some extensions like Google docs viewer etc.. But they are opening files in preview mode. Please help me on this

The .DOC file is binary, and DOCX is a zip file containing a whole collection of XML files that make up a Word document, so neither can easily be read by your straight XML reader.
I don't think there are any native extensions or bits of code for Chrome to edit DOC or DOCX files, so you'd have to write your own - presumably, that's what the extension you're considering would do. You can use the Google docs viewer as a jumping off point - there's no difference between "preview mode" and "edit mode" other than one writes back to the file and the other doesn't. And you'd need to add the controls to modify the document on screen, which may be the larger hurdle.
If you can give some detail on where exactly you're stuck, that might help the community point you towards a solution, but a general "nothing does this for me" is likely to result in a little less help.
Good luck!

you can use jquery for this.
you can use typewith me which is generated in jquery where you can import/export docx,doc.pdf,etc.. files check type with me and private pad
you can use its jquery code for your use as it is opensource.

Related

is there a place online to upload a json file and export it in html?

I have bookmarks downloaded from firefox and they are a json file.
I'm searching for a site where I can upload the json file and then download it in html format.
Does such a site exist?
THANK YOU for your kind assistance.
(Every time I do a search for this question, your site comes up.)
I don't know of a site that will do this online, but I do know of a few other ways:
You could restore them back into a Firefox profile and then export them as HTML from there, like this:
You could download and run a program like https://github.com/andreax79/json2html-bookmarks to convert them locally
You could use JavaScript to convert them in-browser, though not with an actual site, like this: Quick and dirty way to parse a mozilla firefox json file
If you need to display JSON, try with the firefox extension named jsonview.
Check out CodeBeautify, just paste and hit the Beautify button https://codebeautify.org/json-to-html-converter
There’s a lot of plugins and add ons for almost every browser out there; Firefox and especially chrome have great ones as others have mentioned, it’s worth checking out.
You are making it harder than it is. There is no JASON to HTML conversion required. Go to C:\Users\Username\AppData\Local\Google\Chrome\User Data\Default and find bookmark.file. Save it to your desktop. Uninstall the browser but also check the box that asks whether you want to keep history, etc.
Reinstall the browser, then add the bookmark.file to C:\Users\Username\AppData\Local\Google\Chrome\User Data\Default
It will overwrite the file and you have your bookmarks back. It takes about 10 minutes. No coding. No JASON to HTML conversion. Nothing.

How to integrate a json data frame into an html file

I'm currently "learning" d3js by myself and I found a lot of examples here. It seems that for all the visualizations we need two separated files. One is a script (an html file) and the other one is a json file which contains our data set.
I'm curious if there is a way to put the json file into html file so we can have only one file. I think I saw an example like this previously on the internet but I lost it.
The only reason I want to do it like this is that if data set is separated from html file, I cannot use Chrome to view my result (I think Chrome is blocking the script from reading local data set). I can use Firefox to open up my result but the animation doesn't perform smoothly.
Maybe some of my understanding is not really right. But if there is any suggestions please let me know. Thanks in advance.
If you're just using one HTML file, you probably have a <script> tag on your page where all the code is located. You can define your data as a Javascript array.
It can be nice to use multiple files to organize code, data, and view elements (the HTML). This page gives some help on setting your browser to let you do that. For Chrome, close all open windows. Then run Chrome from the 'Run' prompt with this flag: chrome --allow-file-access-from-files

How to edit .mht (web archive) files?

I'm faced with situation when I need to edit a .mht file (for example: add some text to site).
Could you please suggest a way of editing .mht (web archive) files?
What I've tried:
(editors like: notepad, word);
I-Explorer add-ons (like HTML Quick edit Bar)
An MHTML file is a web page archive format. It is meant to be stored and viewed but not to be edited directly.
However, you can easily extract the MHTML file to a regular HTML document (with linked files), edit it with your favorite HTML editor and then export it back to an MHTML archive (including the linked files).
Since you're using Internet Explorer, note that you can open/save between HTML and MHTML files. This can effectively be used to unpack, edit and repack the MHTML archive. Google Chrome can do this as well.
You may also find software that are able to edit the MHTML file directly (doing the unpacking/repacking in the background). Microsoft Word seems to be able to do this, but depending on your document structure, it may impact the content layout.
A quick look at the wikipedia entry for MHTML shows that it's an archive format, a little bit like a zip or rar archive. In order to edit a .mht you will need to unpack it, edit the required file then repack the archive.
You don't say what platform/software you are using but if you do a websearch for ".mht unpacker" you should be able to find something to do the job.
Unpacking a .mht to a local folder, edit the code and re-save it to .mht won't work. If you save to .mht from a local drive none of the linked files (pictures and whatever else is used for the page other than included within the html file) will be stored in the container.
I used Word (office 365) to open modify and save the changes. Maybe is not a optimal solution but works.
WizBrother.com WizHtmlEditor is a super capable fast and light wysiwyg editor that is ideal for quick assembly of elements because it can accept almost anything you throw at it - an entire screen of formatted html including pictures, rtf, drag-n-drop from a browser, and from clipboard, even media files. It doesn't care if it's editing MHT or HTML or several other formats. It's free - and they have a bulk converter BTW. Do a search and see.
I just open and edit with Microsoft Word. This is actually the official approved way of doing it BTW.

just wanna highlight some texts when use a browser to view local html

A lot of tutorials which can be downloaded have the file type of .chm, .pdf, .html, etc. I downloaded a Java SE tutorial of Java SE in HTML format. When I use chrome to view it and everything is good. But I just wonder how could I just directly highlight some useful information (e.g. text) when I use chrome to view it? The html files are local, I know that I could use some software to edit it, like using HTML tag <font color:> etc.
But I just want to highlight it directly in the browser like editing it in word. Is there any suggestion? Dose chrome support such kind of plugin? If you still don't understand what i mean, please refer to "clip to evernote", which is a plugin of chrome and can cut the pages and upload them to the evernote server. when I use evernote client to read them, I can directly highlight some words which is useful to me.
It's much more a SuperUser question, but ... There is a lot of plugins for highlighting web pages out there. You could try Yawas or Simple Highlighter
edit: ok, I think I understood better your problem ... Yawas, Simple Highlighter, as well as most other highlighters, don't hightlight on local pages.
I'm not sure there is such an highlighter available for Chrome, then. What I would suggest is to try opening you documentations with Amaya instead of Chrome. It's both the Browser and the Editor from the W3C; and since it has both functionalities, you probably will be able to do what you want on your local pages.
You can save it to your computer by clicking "Open a new tab containing a list of highlights and notes on just this page". Then you can save only the html contents to your computer with the name as you like. Don't try to use ALT to save the list of note because you will never see the contents what you want to save.

Best way to export html to Word without having MS Word installed?

Is there a way to export a simple HTML page to Word (.doc format, not .docx) without having Microsoft Word installed?
If you have only simple HTML pages as you said, it can be opened with Word.
Otherwise, there are some libraries which can do this, but I don't have experience with them.
My last idea is that if you are using ASP.NET, try to add application/msword to the header and you can save it as a Word document (it won't be a real Word doc, only an HTML renamed to doc to be able to open).
There's a tool called JODConverter which hooks into open office to expose it's file format converters, there's versions available as a webapp (sits in tomcat) which you post to and a command line tool. I've been firing html at it and converting to .doc and pdf succesfully it's in a fairly big project, haven't gone live yet but I think I'm going to be using it.
http://sourceforge.net/projects/jodconverter/
There is an open source project called HTMLtoWord that that allows users to insert fragments of well-formed HTML (XHTML) into a Word document as formatted text.
HTMLtoWord documentation
While it is possible to make a ".doc" Microsoft Word file, it would probably be easier and more portable to make a ".rtf" file.
If you are working in Java, you can convert HTML to real docx content with code I released in docx4j 2.8.0. I say "real", because the alternative is to create an HTML altChunk, which relies on Word to do the actual conversion (when the document is first opened).
See the various samples prefixed ConvertInXHTML. The import process expects well formed XML, so you might have to tidy it first.
Well, there are many third party tools for this. I don't know if it gets any simpler than that.
Examples:
http://htmltortf.com/
http://www.brothersoft.com/windows-html-to-word-2008-56150.html
http://www.eprintdriver.com/to_word/HTML_to_Word_Doc.html
Also found a vbscribt, but I'm guessing that requires that you have word installed.
I presume from the "C#" tag you wish to achieve this programmatically.
Try Aspose.Words for .NET.
If it's just HTML, all you need to do is change the extension to .doc and word will open it as if it's a word document. However, if there are images to include or javascript to run it can get a little more complicated.
i believe open office can both open .html files and create .doc files
You can open html files with Libreoffice Writer. Then you can export as PDF from File menu. Also browsers can export html as a PDF file.
use this link to export to word, but here image wont work:
http://www.jqueryscript.net/other/Export-Html-To-Word-Document-With-Images-Using-jQuery-Word-Export-Plugin.html