如何在pdf文件中显示图像? [英] How to show image in pdf file?

查看:114
本文介绍了如何在pdf文件中显示图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好





我想以图片或徽标的形式导出页面。





当我导出页面时,所有数据和控件都显示在pdf文件中,但图像除外!! ??





我将页面设计为包含许多行和表格的表格。我把backgroundimage放在系统标识上





Hi everyone


I want to export page as pdf with image or logo.


When I export the page all data and controls are shown in pdf file except the image!!??


I designed the page as table with many rows & I put backgroundimage the system logo


<td style="background-image:removed('Images/ARS_header.png');background-repeat: no-repeat;background-removed: center top;" class="style8">
          </td>

< br $>




和这个出口代码:






and this export code:

Response.ContentType = "application/pdf"
      Response.AddHeader("content-disposition", "attachment;filename=Status.pdf")
      Response.Cache.SetCacheability(HttpCacheability.NoCache)
      Dim sw As New StringWriter()
      Dim hw As New HtmlTextWriter(sw)
      pnlPerson.RenderControl(hw)
      Dim sr As New StringReader(sw.ToString())
      Dim pdfDoc As New Document(PageSize.A4, 10.0F, 10.0F, 100.0F, 0.0F)
      Dim htmlparser As New HTMLWorker(pdfDoc)
      PdfWriter.GetInstance(pdfDoc, Response.OutputStream)
      pdfDoc.Open()
      htmlparser.Parse(sr)
      pdfDoc.Close()
      Response.Write(pdfDoc)
      Response.End()







谢谢




Thank you

推荐答案

我不确定究竟是什么问题,但我在将PNG图像嵌入PDF文件时遇到了问题。我尝试将图像转换为JPEG,并且它有效。
I'm not sure what is the exact problem, but I've had problems embedding PNG images inside PDF files. I tried converting images to JPEG, and it worked.


这篇关于如何在pdf文件中显示图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆