Just installed Aspose.pdf.net today and my first task is to convert a selected image file to a PDF. Using the sample and SDK, I can't seem to get it working. It seems to fail (no error message) in getting a reference to the image file. However, I am using pretty much the exact code at this point just to get a demo working.
Protected Sub btnSave_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSave.Click
Dim sFileName As String
Dim sFileExt As String
Dim sFinalFile As String
sFileName = "aspose-logo.jpg"
sFileExt = ".jpg"
Dim license As Aspose.Pdf.License = New Aspose.Pdf.License
Dim myStream As System.IO.FileStream = New System.IO.FileStream(Server.MapPath("~/bin/Aspose.Total.lic"), System.IO.FileMode.Open)
license.SetLicense(myStream)
Dim pdf1 As Pdf = New Pdf()
Dim sec1 As Section = pdf1.Sections.Add()
Dim image1 As Aspose.Pdf.Image = New Aspose.Pdf.Image(sec1)
Dim img As New Image
img.ImageInfo.File = "http://www.aspose.com/Images/aspose-logo.jpg"
img.ImageInfo.ImageFileType = ImageFileType.Jpeg
img.ImageInfo.Title = "JPEG Image"
sec1.Paragraphs.Add(image1)
sFinalFile = Server.MapPath("~/FILES/" & Replace(sFileName, sFileExt, "") & ".pdf")
pdf1.Save(sFinalFile)
End Sub