Quantcast
Channel: HTML Renderer
Viewing all articles
Browse latest Browse all 693

New Post: Loading Image in the html before converting to image

$
0
0

Arthur,

Code I used to generate the image

strHTML = "<html><head><style type='text/css'> .datatable{font-family: 'Arial Narrow', Arial, 'Helvetica Condensed', Helvetica, sans-serif;font-size:10px;font-weight:normal;color:#000;background-color:#ffffff;border:1px solid #7F7F7F; border-spacing: 0;margin:0;padding:0;width:100%;}</style></head><body>

SALARIEDSELF EMPLOYEDUnknown
No Of Approvals4364831479989
</body></html>";

m_Bitmap = new Bitmap(intdatawidth, intdataheight);

PointF point = new PointF(0, 0);

SizeF maxSize = new System.Drawing.SizeF(intdatawidth-10, intdataheight);

HtmlRenderer.HtmlRender.Render(Graphics.FromImage(m_Bitmap),strHTML,point, maxSize);

string imgstroepath = Server.MapPath("~/log/" + strOutputfilename + "2.png");

m_Bitmap.Save(imgstroepath, System.Drawing.Imaging.ImageFormat.Png);

m_Bitmap.Dispose();)

Attached herewith the image that is generated.

In my previous mail also I attached the image.

From the Discussion web page I am not able to attach the attachment. I am using my mail to attach the attachment. Please let me know in case if you are not getting the image.

Regards & thanks,

Arumairaj Isaac.

From: Isaac A
Sent: 07 April 2014 20:28
To: '[email removed]'
Subject: RE: Loading Image in the html before converting to image [HtmlRenderer:541313]

Hi Arthur,

Thanks for the reply. I followed the link and was able to use the css. But the texts are shown bold even though i had specified the font-weight as normal.

<html><head><style type='text/css'> .datatable{font-family: 'Arial Narrow', Arial, 'Helvetica Condensed', Helvetica, sans-serif;font-size:10px;font-weight:normal;color:#000;background-color:#ffffff;border:1px solid #7F7F7F; border-spacing: 0;margin:0;padding:0;width:100%;}</style></head><body>

SALARIEDSELF EMPLOYEDUnknown
No Of Approvals4364831479989
</body></html>

I tried changing the font family to Tahoma etc, then too the fonts are bold.

Can you please let me know, if I am missing something.

Regards & thanks,

Arumairaj Isaac.


Viewing all articles
Browse latest Browse all 693

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>