Two Pilots™    Home  |  Navigation  |  Site Map  |  Products  |  Download  |  Prices  |  For Partners  |  Support

All forums · Statistics · Search ·

Two Pilots forum / For software developers / Inserting an image (PDF Creator)
Author Message
# Posted: 4 Mar 2013 13:37

Having a hard time inserting an image PDF document in a web application written in The image is found in an Images folder in my application, debugging I don't believe the image is getting added, as PDF.GetImageCount() is returing 0. No errors are generated and the PDF is created, without an image. I read the online documentation for AddImageFromFile, not sure what I am doing wrong.

'reduce file size
PDF.Compression = PDFCreatorPilotLib.compressionType.coFlate

Dim font1 As Integer
font1 = PDF.AddFont("Verdana", True, False, False, False, 0)
PDF.UseFont(font1, 12)
PDF.PageOrientation = PDFCreatorPilotLib.PaperOrientation.pPortrait
PDF.ShowTextAt(40, 20, "Vendor Attendee List")

'long AddImageFromFile(pathTofile)
Dim imgPath As String = Server.MapPath("Logo.jpeg")
Dim headImage As Integer = PDF.AddImageFromFile(imgPath)
Dim imgCnt As Integer = PDF.GetImageCount()
PDF.ShowImage(headImage, 80, 200)

'PDF.DeletePage(PDF.GetPageCount() - 1)
'PDF.SaveToFile("C:Invoice_Stat_ReportVendorAttend eeList.pdf", True)

Response.ContentType = "application/pdf"
Response.AddHeader("Content-Type", "application/pdf")
Response.AddHeader("Content-Disposition", "inline;filename=VendorAttendeeList.pdf")

# Posted: 5 Mar 2013 07:31


Check what is the index value of loaded image, please.

Best regards,
Artem Golubnichenko
Two Pilots



Powered by miniBB 2.0 RC7 © 2001-2004 Page creation time (sec.): 0.013


Page top