views:

91

answers:

4

In .Net (C#) server process, i want to generate image with lot of rich text (with paragraphs, font style, etc.. ). The richtext can be described using RTF or HTML.

Is there any way to convert RTF/HTML to a image ? Since it is a server process, i want to avoid windows forms controls.

+1  A: 

You could possibly use a virtual printer and print to an image.

Nifle
A: 

Hi, not sure what you are trying to do.

If it is like autogenrating on the server a pass certificate for a user which they can then print off then I would use a generic handler .ashx and build the image in memory then write it to the response.

If the end user is putting the text etc into their browser and posting back then have a look at the webbrowser control or if you prefer, it's activex predecesor (which is more feature rich IMO). I know you want to steer away from the Forms side of things but you can create and use one of these controls in memory. I'm thinking it would be possible to render the returned html in the browser (you might have to use some javascript and a hidden field to get the plain HTML without the viewstate issues). From there it might be possible to grab or print the screen(or what would have been on the screen if the control had actually been displayed)! I'm sure I've used this dodge before, somewhere.

Give me some more details and I'll try and get some examples together for you.

Mike
A: 

how to save the content of richTextBox as jpg file?

hjb417
He said he wanted to avoid windows forms controls
Nifle
Damn it. Good eye Nifle.
hjb417
A: 

You can look into Snowbound Rastermaster (commercial SDK). Maybe they will be mission capable for you.

http://snowbound.com/rastermaster_net/net_overview.html

Albert