How can I get images from API in Custom print format instead of frappe files?

Hi everyone,

I have created a custom print format where I can print all form data using Jinja but there are some images that I am storing on external server and I want to get those images and displayed on print page.

note: images are in base64 and I have tried localstorage it is working but need to get it form api each time I want to print.

thank you