我正在使用下面的代码生成pdf。有没有办法可以指向图像并将其用作标题?“~/images/Header.png”?任何帮助,将不胜感激。谢谢你。
Dim myUniqueFileName = String.Format("{0}.pdf", random)
Dim pdfWrite As PdfWriter = PdfWriter.GetInstance(Doc1, New FileStream(path & myUniqueFileName, FileMode.Create))
Dim ev As New itsEvents
pdfWrite.PageEvent = ev
Doc1.Open()
Dim test As String
test = Session("PDF")
Doc1.Add(New Paragraph(test))
Doc1.Close()
End Sub
Public Class itsEvents
Inherits PdfPageEventHelper
Public Overrides Sub OnStartPage(ByVal writer As iTextSharp.text.pdf.PdfWriter, ByVal document As iTextSharp.text.Document)
Dim ch As New Chunk("This is my Header on page " & writer.PageNumber)
document.Add(ch)
End Sub
End Class