views:

1145

answers:

5

Hi there,

I have some problem with inserting image when i generate pdf using FPDF library (ASP port version) you can get it here ASP FPDF

I have tried this code (this was ASP VBScript):


pdf.Image Server.MapPath("map.jpg"), 10, 10, 800, 400
pdf.Image "map.jpg", 10, 10, 800, 400
pdf.Image "http://localhost/pdf_test/map.jpg", 10, 10, 800, 400

None of the codes above work... it keeps throw an error:


Microsoft JScript runtime  error '800a138f'

Object expected

/pdf/libs/fpdf.asp, line 817


And from fpdf.asp line 817 (This was ASP JScript):


type=SupposeImageType(xfile);


However, without inserting image(s) a.k.a text-only pdf it works fine. Can someone help me fix this thing?

Thanks
Dels

A: 

Did you find a solution for this??? IS it running for you now?? I am also trying to add image in pdf but its not showing up.Text works fine.

no it never works
Dels
A: 

hi; in fpdf/include/images.asp;

you do this changes; this.Buffer.CharSet ="ISO-8859-1" to your charset.

regards.

Senturk
A: 

Hi there, I added this line of code but it did not help. Any other clue? Jaap

Jaap van Goor - Promanent
A: 

well i solve this with the permits in directory for the iusr full control but now i am trying with a nested image and i cant

Mario
A: 

this is the code i used to display image in the header. the problem i have is i want to use a variable for the image, when i put the variable name instead of the image name i get an error:

Microsoft JScript runtime error '800a138f'

'undefined' is null or not an object

/EKtestdb/fpdf/fpdf/includes/Basics.asp, line 121

    this.Header=function Header()
  {
  this.SetY (10)
  this.SetFont ("Times","",10)
  //this.Cell (45,5, "HEADER", 0, 0, "L")
  this.SetFont ("Times","b",14)
  //this.Cell (190,5, this.title, 0, 0, "C")
  this.Cell (190,20, this.title, 0, 0)
  this.SetFont ("Times","",10)
  this.Image('logoSM1.jpg',165,3,33)
  this.Image( techpic ,165,3,33)

this is the code for basics.asp line 121:

this.strrpos=function strrpos(s,ch){
 res = s.lastIndexOf(ch)
 if (res>0-1){return res}else{return false}
}
this.strpos=function strpos(s,ch,start){
 if (arguments.length<3){start=0}
 res = s.indexOf(ch,start);
 if (res>-1){return res}else{return false}
}

if you just want to display an image this line should work:

this.Image('logoSM1.jpg',165,3,33)

but for using a variable instead of image name can someone help with this?

bluffo