Showing posts with label mhtml. Show all posts
Showing posts with label mhtml. Show all posts

Monday, March 12, 2012

MHTML vs PNG rendering.

Has anyone else noticed that rendering to MHTML produces great results
(non-blocky fonts) versus rendering to PNG? Extremely frustrating
since the images within the MHTML are themselves PNGs.
Anyhow, a way around it is to render the MHTML, capture it to a byte
array, convert that byte array to a string, yank out all but the PNG
information, convert it back to a byte array, and stream that to your
browser as an image. Works great, and this way you can introduce your
own caching and security measures.
I tend to not check messages here often, only when I have a problem
and I'm stuck for ideas. Email me at warty_2FISHYFISHY@.yahoo.com minus
the FISHYFISHY if you want to reach me.Actually in my case the image was the only important part (I am only
generating a graph). It wouldn't be hard to parse the HTML rather than
delete it however. The real bonus is that the text within the PNG
seems to generate nicely when done through MHTML.
"eglasius" <eglasius@.discussions.microsoft.com> wrote in message news:<C0891A02-B204-4A05-A890-E3E26542C647@.microsoft.com>...
> I am not clear at the exact thing u did ... if u are talking about rendering
> the report as an image, then playing with the deviceinfo config, probably
> would have helped ...
> ms-help://MS.RSBOL80.1033/RSPROG/htm/rsp_prog_soapapi_dev_9xip.htm
> if it is that, I dont see how rendering to mhtml and taking the images in
> there solves the problem, since u will be loosing all your report text ...
> the only thing left would be the actual images ...
> I probably misundertand your post ...|||I am not clear at the exact thing u did ... if u are talking about rendering
the report as an image, then playing with the deviceinfo config, probably
would have helped ...
ms-help://MS.RSBOL80.1033/RSPROG/htm/rsp_prog_soapapi_dev_9xip.htm
if it is that, I dont see how rendering to mhtml and taking the images in
there solves the problem, since u will be loosing all your report text ...
the only thing left would be the actual images ...
I probably misundertand your post ...
"Matt Hartman" wrote:
> Has anyone else noticed that rendering to MHTML produces great results
> (non-blocky fonts) versus rendering to PNG? Extremely frustrating
> since the images within the MHTML are themselves PNGs.
> Anyhow, a way around it is to render the MHTML, capture it to a byte
> array, convert that byte array to a string, yank out all but the PNG
> information, convert it back to a byte array, and stream that to your
> browser as an image. Works great, and this way you can introduce your
> own caching and security measures.
> I tend to not check messages here often, only when I have a problem
> and I'm stuck for ideas. Email me at warty_2FISHYFISHY@.yahoo.com minus
> the FISHYFISHY if you want to reach me.
>

MHTML Streaming

I am streaming an MHTML file to an aspx page:
Response.Clear()
Response.AddHeader("Content-Disposition", "inline; filename=MyFile.mht")
Response.AddHeader("Content-Length", MyByteArray.Length.ToString)
Response.ContentType = "multipart/related"
Response.BinaryWrite(MyByteArray)
Response.Flush()
When I load the aspx page on my computer with IE... I get "Invalid syntax
error"... when I load the same page... thru HTTP access from a co-worker's
computer... it loads fine... what am I doing wrong?
Not sure if it makes a difference... I had the address bar hidden so I didn't
notice at first... when my co-worker renders the stream the url stays the
same... for me I get mhtml: in front of the url... in addition to the
"invalid syntax" error.I figured I should post this in case other ppl were looking for some
answers... apparently my MHTML issue has something to do with a security
patch for IE... there is however a way to get around it...
You can attach a dummy query string to your aspx page that ends with a .mht.
For example, if the page that streams down mht content is MyPage.aspx, then
you want to use this URL:
http://Path-To-File/MyPage.aspx?ignored=whatever.mht
"MER78" wrote:
> I am streaming an MHTML file to an aspx page:
> Response.Clear()
> Response.AddHeader("Content-Disposition", "inline; filename=MyFile.mht")
> Response.AddHeader("Content-Length", MyByteArray.Length.ToString)
> Response.ContentType = "multipart/related"
> Response.BinaryWrite(MyByteArray)
> Response.Flush()
> When I load the aspx page on my computer with IE... I get "Invalid syntax
> error"... when I load the same page... thru HTTP access from a co-worker's
> computer... it loads fine... what am I doing wrong?
> Not sure if it makes a difference... I had the address bar hidden so I didn't
> notice at first... when my co-worker renders the stream the url stays the
> same... for me I get mhtml: in front of the url... in addition to the
> "invalid syntax" error.

MHTML

I'm trying to figure out how many people out there have access to the MHTML
format. From what I read... it isn't a Microsoft standard... but IE is the
only browser that directly supports it... so here's my issue... when I try to
open an MHTML file in FireFox or Netscape... they both ask me if I want to
open with mhtmlfile... would this happen for all people with IE on their
machine... aka everyone... or is this mhtmlfile program part of Windows XP?There is a description of MTML format here:
http://www.faqs.org/rfcs/rfc2110.html
--
Rajeev Karunakaran [MSFT]
Microsoft SQL Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"MER78" <MER78@.discussions.microsoft.com> wrote in message
news:A6E890E3-4A38-4B2B-9543-8F2007462522@.microsoft.com...
> I'm trying to figure out how many people out there have access to the
> MHTML
> format. From what I read... it isn't a Microsoft standard... but IE is
> the
> only browser that directly supports it... so here's my issue... when I try
> to
> open an MHTML file in FireFox or Netscape... they both ask me if I want to
> open with mhtmlfile... would this happen for all people with IE on their
> machine... aka everyone... or is this mhtmlfile program part of Windows
> XP?|||The document u suggest explains what MHTML is... I know what it is... my
question was more about mhtmlfile... when I try to open an MHTML file in
firefox or netscape... they both ask me if I want to open with mhtmlfile...
and I wanted to know if this program was on my computer because (a) it comes
with XP... or (b) it comes with IEX and up...
"Rajeev Karunakaran [MSFT]" wrote:
> There is a description of MTML format here:
> http://www.faqs.org/rfcs/rfc2110.html
> --
> Rajeev Karunakaran [MSFT]
> Microsoft SQL Server Reporting Services