Hi there,
I am using the ASP to PDF component from www.asppdf.com and have an
unusual problem when displaying a blob from the database.
When there is an image stored in my SQL2000 field of type image, and I
use this:
Params = "x=337; y=408; scalex=.33; scaley=.33"
Set SigImage = Doc.OpenImageBinary(rsMotor("Photo").Value)
Page.Canvas.DrawImage SigImage, Params
The image gets drawn in the PDF and everything is fine.
If I try to create a PDF using the same record, but where the image
filed is NULL, I get this error:
Persits.PdfManager.1 error '800a002f'
A safe array of bytes is expected as an argument.
So I thought I need to check if the field isn't null before attempting
to draw it onto the canvas, so I tried this:
If LEN(rsMotor("Photo").Value) 0 Then
'Insert Photo
Params = "x=337; y=408; scalex=.33; scaley=.33"
Set SigImage = Doc.OpenImageBinary(rsMotor("Photo").Value)
Page.Canvas.DrawImage SigImage, Params
End if
Using this with an image stored in the field gives me the same error
message, its only when the field is empty that the above code works and
doesn't draw the image on the PDF.
I also tried this:
If NOT(ISNULL(rsMotor("Photo").Value)) Then
'Insert Photo
Params = "x=337; y=408; scalex=.33; scaley=.33"
Set SigImage = Doc.OpenImageBinary(rsMotor("Photo").Value)
Page.Canvas.DrawImage SigImage, Params
End if
But still got the same error.
If I don't use any checking code, and have NULL in the image field, I
get the same error. This must be something to do with the binary
content, how can I detect if there is binary content?
Steve