I have a web page which need to export into Microsoft Word document. And this page contains picture which is too large after exporting into .doc file. Here is my code:
StringBuilder strHTMLContent = new StringBuilder();
//appending the style sheet
strHTMLContent.Append("<style>.labelalign {float: right !important;}.imgDiv{height: 83px; width: 90px; float: right;}.design {font-size: 16px;}.design1 {font-size: 15px;}.td {background-color: #A4A4A4;}</style>".ToString());
Response.Clear();
Response.AddHeader("content-disposition", "attachment; filename=" + txtcandidatename.Text.Trim() + ".doc");
Response.Charset = "";
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.ContentType = "application/vnd.ms-word ";
StringWriter stringWrite = new StringWriter();
HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite);
mydiv.RenderControl(htmlWrite);
Response.Write(strHTMLContent.Append(stringWrite).ToString()); // send the stringWrite
Response.End();
Response.Flush();
}
I want to resize the image inside the mydiv. This image is already fixed in size inside the TD but still when exporting it is taking the original size of the image.
Here is the table code:
<table style="width: 899px;" align="center" cellpadding="4" cellspacing="3">
<tr>
<td style="width: 50%">
</td>
<td style="width: 90px; float: right; height: 83px;" class="imgDiv">
<asp:Image ID="candidateimg" runat="server" CssClass="imgDiv" ImageUrl="http://localhost:59055/ExportPDF/Image/photo.jpg" ImageAlign="Right" Width="90px" Height="83px" /></td>
</tr>
</table>
Please help me by suggesting how do I resize the image. Thanks.