我可以在iTextSharp v4.1.2中添加文本标题但是如何添加图像而不是文本?我目前正在使用文本标题,但我想用图像替换它。
' Create a Document object
Dim doc As Document = New Document(PageSize.LETTER)
doc.SetMargins(pageMarginLeft, pageMarginRight, pageMarginTopBottom, pageMarginTopBottom)
' Create a new PdfWriter object, specifying the output stream
Dim writer As PdfWriter = PdfWriter.GetInstance(doc, HttpContext.Current.Response.OutputStream)
' Set header and footer
Dim headerFont As iTextSharp.text.Font = FontFactory.GetFont("Arial", 12, iTextSharp.text.Color.BLUE)
Dim header As New HeaderFooter(New Paragraph("VOLUNTEER MASTER SCHEDULE", headerFont), False)
Dim footerFont As iTextSharp.text.Font = FontFactory.GetFont("Arial", 8, iTextSharp.text.Color.BLACK)
Dim footer As New HeaderFooter(New Phrase("Page: ", footerFont), True)
doc.Header = header
doc.Footer = footer
' Open the Document for writing
doc.Open()