[SOLVED] Converting MHT files to something useful.
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I've a heap of old MHT files from back in the days when Opera was a useful browser. I've just installed the latest version solely in order to use it for opening and converting them, but it's pretty dreadful and has upset the system (Debian 10.1).
I seem to recall that there was a conversion utility, though exactly what it did I can't recall. MHT is a "container" format - somewhat similar to PDF I'd think - so it should be possible to convert an MHT file into an HTML file and a directory containing the "other bits": CSS, Js, images and so forth.
Firefox is my default browser, and I've seen this advice elsewhere. It may once have been true but seems to be no longer. My search of Firefox extensions produced no results. You may recall that Ff underwent a major "upgrade" a few years back which was, in fact, a major DOWN-grade: all of the best add-ons disappeared due to major changes in the API (for "security reasons", of course) and few of them have come back.
Not sure about Chrome, and given that Google owns it I'm reluctant to install it, even for offline use.
If you’re willing to use Windows to convert MHTs into something usable in Linux, there is at least one way. If you can’t / don’t want to use Windows, then read no further.
Word is able to open MHT files (in Windows Explorer, right click the file, then Open With), or more specifically I know that the most recent Word desktop app in Windows 10 (and at work we’re still on 1709) is able to open MHT files generated by the MS Office suite apps on my work computer. If you have a bunch of MHTs to convert, to save time, right click on any MHT file, click on Properties, and make Word the default app to open MHTs.
Since most people at work don’t know what an MHT file is, if I have to share a file I have saved as MHT in an MS Office app, I just change the extension to .doc and Word can display that correctly. Note: not .docx, which then opens in Word with messed up formatting.
From Word, you can then Save As several formats including pdf.
Thanks for the list of links, teckk. I was hoping for a commandline solution rather than ANOTHER browser to further complicate my system, and these seem to promise one.
There are a number of online conversion utilities, but I'm always wary of such things due to Zuckerberg's Law:
"If it's online and it's free, then YOU are the product; and you WILL be sold."
MHT and PDF have always disappointed me. Both fulfill an obvious real requirement, but were created by two of the worst corporations in the business. Adobe's PDF utility has always been a nightmare: it takes over the whole system without so much as a by-your-leave, whereas MHT is relatively harmless. A pity that FOSS hasn't produced alternatives to both.
Thank you teckk!
This command line tool works perfectly with mht files created by Internet Explorer. I've just used it on several files of various age (up to some years old).
The Firefox extensions I found, did not do the job.
MHT and PDF have always disappointed me. Both fulfill an obvious real requirement, but were created by two of the worst corporations in the business. Adobe's PDF utility has always been a nightmare: it takes over the whole system without so much as a by-your-leave, whereas MHT is relatively harmless. A pity that FOSS hasn't produced alternatives to both.
mht files are identical to mhtml. You can open them in any Chromium-based browser. Like you, I have a ton of old Opera .mht files, and I can open them directly in Falkon. I imagine Brave can read them as well.
An improvement over .mht/.mhtml is the SingleFile add-on, which is available for both Firefox and Chrome. It saves the entire web page, pictures included, as a normal html file that can be opened in any browser. It's what I've been using for the last several years. https://addons.mozilla.org/en-US/fir...n/single-file/
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.