遇到了两个问题
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()