LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

html to mht


@perro wrote:
About MS Word XP. You can convert a html file into MHT file...



Yeah that's why I never saw it... don't have the latest version (XP).
0 Kudos
Message 11 of 17
(2,864 Views)
Alright... here's the beta version of my HTML -> MHTML conversion library. I am leaving the source code unlocked so you can look at it and modify it as necessary, but but I would really prefer to hear back on any issues so I can incorporate them.

A few notes about it...

- My real operating requirement here is to convert LabVIEW reports.

- With that in mind, there is no current support for content style sheets (.css). I can't imagine that would be hard to add though.

- For pictures, there is encoding support for .jpg, .gif, .bmp, .png

- Since all binary encoding is base64, it's pretty simple to expand encoding to files of other extensions--those are just the ones I could think of.

- The quoted-printable encoding, which is used for HTML and text files (and doesn't typically add an extra 1/3 to the file size like base64 encoding does), works, but isn't the greatest discriminator of when to make line breaks. For my tests, my reports have rendered just fine once they've been archived, but looking at the quoted-printable encoded HTML file within the .MHT archive it's just not quite as pretty as it is when IE does it.

Let me know how it works for you...
Message 12 of 17
(2,862 Views)
I've got a problem with your program. It's a LabView 7.1 Application and my LabView is 6.1 Version.
Can you Save it as a 6.1 Application.
Thanks
0 Kudos
Message 13 of 17
(2,852 Views)

@perro wrote:
I've got a problem with your program. It's a LabView 7.1 Application and my LabView is 6.1 Version.
Can you Save it as a 6.1 Application.
Thanks




My code is not backwards compatible with version 6.1 because it uses Express VI's to build blocks of text for the MHTML file header and the sub-file content headers. I converted back to 6.1 however and converted the Express VI's manually--which I will probably never do again--what a pain.

Here is the converted library... if it doesn't work, it's probably because the headers aren't right, because I haven't checked them to make sure their absolutely correct. I am also posting the updated v7.1 code in which I added the option to add aditional content to the MHTML file, even if it isn't linked to directly in the HTML file (I needed that for my particular problem).
Message 14 of 17
(2,847 Views)
Here is the 'Version 1.0' of the HTML -> MHTML library, saved in LabVIEW 7.1 format.
Message 15 of 17
(2,845 Views)
I just found another nifty little trick that I think is going to be quite helpful.

If you have several embedded objects (HTML files and picture files), you may access/extract them individually using the following syntax:

mhtml:file://%Original Path%!%Content Path%

Where:

%Original Path% might be C:\Reports\MyReport.mht

and

%Content Path% might be ReportPicture1.png or EncodedSubDocument.html

This will load a particular picture or HTML file into the browser if it's embedded in the .MHT file.
Message 16 of 17
(2,825 Views)
m3nth.  First off, nice job on the organization of your "MHTML1.llb"!  However, I attempted to use it to convert an html document (containing only 18 jpeg images) into a single file mht.  At first glance, it seems to have embedded the images just fine.  However, when I emailed the new mht file, it would not show any of the images, unless I sent all the jpegs along with it.  I inspected the mht source text and found that it appears to have included each image's data, but still has the image path listed.  Any ideas on how to correct this issue?  Anyone else know an easy/quick method of converting a Labview built html file (made with report generation) into a single file mht??  How about a 3rd party app that can be called programmatically?
0 Kudos
Message 17 of 17
(2,297 Views)