Image on pdf error if not set to Hi-DPI

I have an image in my project that I place onto a PdfDocument using this code.

try
  Document.Graphics.DrawPicture(invoice_header.ImageAt(0), 15, 15, invoice_header.ImageAt(0).Width, invoice_header.ImageAt(0).Height, 0, 0, invoice_header.ImageAt(0).Width, invoice_header.ImageAt(0).Height)
catch e as RuntimeException
  messagebox(e.message)
end try

I get a blank error message if I turn off Hi-DPI. How can I fix this to work without Hi-DPI support?
I have tried different sized images but nothing seems to work.
It does work fine if Hi-DPI support is selected.
Thanks

somehow this if your app use Hi-DPI
https://docs.xojo.com/Picture.BestRepresentation
if project Hi-DPI is diabled then just the image name.

That fixed it. Works as expected now.
Thanks for your help.

Forum for Xojo Programming Language and IDE. Copyright © 2021 Xojo, Inc.