I have searched everywhere and cannot find an example of adding a .png image to a PDF.
I am getting this error
Couldn't open image file: C:\WebTest\AsposePdfDemosVisualBasic\brandt.png
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ApplicationException: Couldn't open image file: C:\WebTest\AsposePdfDemosVisualBasic\brandt.png
The file is in the same folder as brandt.tiff which works. I read on another post about the possibility of permissions issues but have ensured that permissions are set correctly. The png file was set to 24 bit with transparency set to true.
Here is my code. This works!
Dim pdf1 As Pdf = New Pdf
Dim sec1 As Section = pdf1.Sections.Add()
Dim image1 As Aspose.Pdf.Image = New Aspose.Pdf.Image(sec1)
sec1.Paragraphs.Add(image1)
image1.ImageInfo.File = "C:\WebTest\AsposePdfDemosVisualBasic\brandt.tiff"
image1.ImageInfo.ImageFileType = ImageFileType.Tiff
Here is my code. This doesnt work!
Dim pdf1 As Pdf = New Pdf
Dim sec1 As Section = pdf1.Sections.Add()
Dim image1 As Aspose.Pdf.Image = New Aspose.Pdf.Image(sec1)
sec1.Paragraphs.Add(image1)
image1.ImageInfo.File = "C:\WebTest\AsposePdfDemosVisualBasic\brandt.png"
image1.ImageInfo.ImageFileType = ImageFileType.Png
I am confused as to why a png image causes an error.
Thanks for your help.
Tyler