I am using the free version of Spire.PDF (Spire.Pdf.dll 3.2.52.56040) and I trying to replace an image in PDF document but ReplaceImage function is not working.
- Code: Select all
Dim doc As PdfDocument = New PdfDocument
doc.LoadFromFile("C:\_ftp\B\pdf.pdf")
'Dim inf = doc.Pages(0).ImagesInfo
'Dim image = inf(0).Image
'replace image
doc.Pages(0).ReplaceImage(0, PdfImage.FromFile("C:\_ftp\B\tmp.jpg"))
doc.SaveToFile("C:\_ftp\B\pdf_new.pdf", FileFormat.PDF)
pdf_new.pdf file has the old image and the same size as original
Any help would be greatly appreciated.