Hi,
The variable $img->url should normally contains something like that:
"/images/com_hikashop/upload/thumbnails/100x100f/myimage.jpg"
That' a relative path. So you already are using a relative path.
What's before the first / is filled by the browser (or the HTML2PDF library in this instance).
So what you can do is prepend the URL of the website so that you force it to use the full URL instead of letting it guess it.
So for example, instead of:
echo '<img src="'.$img->url.'" alt="" style="float:left;margin-top:3px;margin-bottom:3px;margin-right:6px;"/>';
you could try:
echo '<img src="https://www.mywebsite.com'.$img->url.'" alt="" style="float:left;margin-top:3px;margin-bottom:3px;margin-right:6px;"/>';
Of course, this is an example. You need to replace
www.mywebsite.com
by your real website URL.
And that's just what I remember from memory.
The best would be to first directly echo the variable $img->url to see what's inside so that you can prepend what's needed accordingly.