我的代码没有将图像添加到PDF文件中,我缺少什么吗?
Private Sub AddPDFImage()
Dim PdfReader As PdfReader = New PdfReader("PDF INPUT FILE")
Dim PdfStamper As PdfStamper = New PdfStamper(PdfReader, New FileStream("PDF OUT PUT FILE", FileMode.Create))
Dim PdfImage As iTextSharp.text.Image
Dim bytContent As PdfContentByte
PdfImage = iTextSharp.text.Image.GetInstance("Image")
PdfImage.ScalePercent(100)
PdfImage.SetAbsolutePosition(50, 110)
bytContent = PdfStamper.GetOverContent(1)
bytContent.AddImage(PdfImage)
PdfStamper.FormFlattening = False
PdfStamper.Close()
PdfReader.Close()
End Sub