Foxtable(狐表)用户栏目专家坐堂 → 控件打印问题


  共有1922人关注过本帖平板打印复制链接

主题:控件打印问题

帅哥哟,离线,有人找我吗?
aidimeng
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:三尾狐 帖子:741 积分:7250 威望:0 精华:0 注册:2015/9/14 14:26:00
控件打印问题  发帖心情 Post By:2018/12/23 13:33:00 [只看该作者]

遇到了两个问题

Dim wb As WinForm.WebBrowser = e.Form.Controls("WebBrowser1")
wb.Address=Vars("路径")

1、窗口中的 pdf不能显示,提示 文件保存

2、打印问题

 

在webbrpwser 控件上面 加了个 Label 控件,想把 这两个控件的内容 打在一起

 

使用 Dim doc As PrintDoc = e.Form.GernatePrintDoc()
        doc.Preview()

  只能看到 web中的内容 没有 label的内容

 

 

 

pdf文件的生成

Dim reader As New iTextSharp.text.pdf.PdfReader("c:\test.pdf")
Dim document As New iTextSharp.text.Document(reader.GetPageSizeWithRotation(1))
Dim n As Integer = reader.NumberOfPages
Dim baos As New IO.FileStream("c:\123.pdf", IO.FileMode.Create, IO.FileAccess.Write)
Dim copy As New iTextSharp.text.pdf.PdfCopy(document, baos)

Dim ownerPassword = Encoding.default.GetBytes("12345")
copy.setEncryption(Nothing, ownerPassword, iTextSharp.text.pdf.PdfWriter.ALLOW_SCREENREADERS,False)
copy.setEncryption(Nothing, ownerPassword, iTextSharp.text.pdf.PdfWriter.ALLOW_DEGRADED_PRINTING,False)
copy.setEncryption(Nothing, ownerPassword, iTextSharp.text.pdf.PdfWriter.ALLOW_MODIFY_ANNOTATIONS,False)
copy.setEncryption(Nothing, ownerPassword, iTextSharp.text.pdf.PdfWriter.ALLOW_FILL_IN,False)
copy.setEncryption(Nothing, ownerPassword, iTextSharp.text.pdf.PdfWriter.ALLOW_ASSEMBLY,False)
copy.setEncryption(Nothing, ownerPassword, iTextSharp.text.pdf.PdfWriter.ALLOW_COPY,False)
copy.setEncryption(Nothing, ownerPassword, iTextSharp.text.pdf.PdfWriter.ALLOW_MODIFY_CONTENTS,False)
copy.setEncryption(Nothing, ownerPassword, iTextSharp.text.pdf.PdfWriter.ALLOW_PRINTING,False)
copy.ViewerPreferences = iTextSharp.text.pdf.PdfWriter.HideToolbar Or iTextSharp.text.pdf.PdfWriter.HideMenubar Or iTextSharp.text.pdf.PdfWriter.HideWindowUI
'往pdf中写入内容
document.Open()
For i9 As Integer = 1 To n
Dim page As iTextSharp.text.pdf.PdfImportedPage = copy.GetImportedPage(reader, i9)
copy.AddPage(page)
Next
document.Close()
reader.Close()


 回到顶部