Reputation: 2425
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
Upvotes: 0
Views: 5545
Reputation: 1
In fpdf/include/images.asp
do these changes to your charset:
this.Buffer.CharSet ="ISO-8859-1"
Upvotes: 1
Reputation: 18
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?
Upvotes: 0