如何使用html将图像设置为pdf文档中的标题

问题描述:

先生,



我想在pdf中添加图片作为标题,目前我正在使用html生成pdf,我可以将文字作为标题但是我不能给图像标题,所以请给我解决方案。



目前我使用下面的代码生成pdf



Hi sir,

I want to add image as header in pdf,at present i am using html to generate pdf in this i can give text as header but i can not give image header so please give me solution.

at present i am using below code for generating pdf

strHtmlString.Append("<tr><td colspan='10'></td></tr>");
                strHtmlString.Append("<tr><td colspan='2' align='left'><b>Exclusions</b></td><td colspan='8' align='left' >: Any other works not specifically mentioned in our scope of work</td></tr>");


                strHtmlString.Append("<tr><td colspan='10'></td></tr>");

                strHtmlString.Append("<tr><td colspan='2' align='left'><b>Kind Regards,</b></td><td colspan='3' align='left' > &nbsp;</td> <td colspan='2' align='left'><u><b>Approved by Client</b> </u></td><td colspan='3' align='left'>&nbsp;</td></tr>");

                strHtmlString.Append("<tr><td colspan='3' align='left'><b>&nbsp;</b></td><td colspan='2' align='left' > &nbsp;</td> <td colspan='2' align='left'><b>Signature:</b></td><td colspan='4' align='left'>&nbsp;</td></tr>");


                strHtmlString.Append("<tr><td colspan='5'></td></tr><tr><td colspan='5'></td></tr>");









提前感谢





thanks in advance

使用标签 img src =ImageNameWithPath /&GT;你的HTML中的标签然后可以创建如下:



img src =ImageNameWithPath width = 190height =100/>
Use the Tag img src="ImageNameWithPath" /> tag in your html then can create it like below :

img src="ImageNameWithPath" width="190" height="100" />


img src =ImageNameWithPathwidth =190height =100/>



如akhi所说,它会做....
img src="ImageNameWithPath" width="190" height="100" />

as akhi has mentioned it will do....