PDF.Graphics: Using GetData on an image is not supported

I would create a PDF document with text and pictures. “MyPic32” is a picture with two images (one is 32 x 32 pixel and the other is 64 x 64 pixel. I got the error “Using GetData on an image is not supported”

var mPDF as new PDF.PDFDocument(PDFDocument.PageSizes.A4)
var g as graphics = mPDF.graphics

g.drawingColor = color.Black
g.FontSize = 11.0
g.Bold = True
g.DrawText(“My first PDF file”, 20, 30)

g.DrawPicture(MyPic32, 20, 60)

If I use a picture that has on one image, there is no error and the picture is visible on the PDF file

Not at my Desk currently, but maybe ImageAt may help in such a case?

g.DrawPicture(MyPic32.ImageAt(0), 20, 60)
1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.