Last post Sep 07, 2006 08:02 AM by kamika
Aug 30, 2006 11:25 AM|kamika|LINK
I'm loding an image form the disc and write some text on it using DrawString.
After all I display the image in the Browser: bmp.Save(Response.OutputStream, System.Drawing.Imaging.ImageFormat.Jpeg);
This works completele fine and as expected.
The strange thing is, when I try Print Previewing, Saving or Printing this image, I only get an empty page or a tiny empty image in the top left corner.
The strange thing is, the print preview and printing worked like a charm, but stopped working without a significant change of code.
Aug 31, 2006 04:04 AM|kamika|LINK
I isolated that code part so far.
Letting it run by itself it works fine (display and print preview of the image)
If the page is called using Response.Redirect from an other page the strange thing happens.
Even though the exact same page is called:
- the image is displayed fine.
- BUT print preview, saving and printing gives an empty image WITH the previous page name recommended as save name.
i think this is very strange. I tried different Response.ContenType s an and Clearing the Response at different points.
I'm still clueless
Aug 31, 2006 06:04 AM|kamika|LINK
I figgured out one more thing.
If the page is called directly, when using print preview, the code behind is called again. (this is the case when print preview shows the right picture)
On the redirected version, print preview does not run through the code again. (in this case it is empty)
Strange thing: Firefox shows a correct print preview in the second case, without calling the code behind.
Sep 07, 2006 08:02 AM|kamika|LINK
It's working now with a little trick.
By opening a new window for the image to be displayed print preview and printing is working correct.
I guess I just go with that.