Issue Printing PNG Image on EPSON TM-T88V

20 views
Skip to first unread message

Ray Han

unread,
Mar 21, 2025, 4:55:28 AMMar 21
to qz-print
Hi,

I'm having trouble printing a PNG image on an EPSON TM-T88V printer.
The following error appears, even though the file exists and displays correctly in the browser when accessed at: http://localhost/pos/assets/img/header-logo.png.

Error Message:

Error: Cannot parse (FILE)http://localhost/pos/assets/img/header-logo.png into a raw IMAGE command: Server returned HTTP response code: 403 for URL: http://localhost/pos/assets/img/header-logo.png
    at WebSocket.<anonymous> (qz-tray.min.js?v=415105231:1:7508)


I suspect the issue is related to the following function:

function PrintCompanyLogo() {
var opts = {
language: 'ESCPOS',
dotDensity: 'double',
};
return [{ type: 'raw', format: 'image', flavor: 'file', data: '/pos/assets/img/header-logo.png', options: opts }];
}

This script is working fine on multiple machines, but is failing on one specific machine (Windows 10 Pro).
I've already checked permissions, security settings and windows defender. All seems to be fine and I'm running out of ideas.
Any suggestions would be greatly appreciated!

Thanks in advance.

Lite Finocchiaro

unread,
Mar 21, 2025, 10:18:59 AMMar 21
to Ray Han, qz-print
Ray:

Sorry for the trouble. Have you tried another browser? I think it may be related to the http (as opposed to https) URL on localhost. You may have to add some code to allow the browser to access this URL, or the localhost file system may be slightly different on this machine.

What happens when you put the URL for the png into the browser?  Have you tried using the full URL, i.e.:

data: 'http://localhost/pos/assets/img/header-logo.png' as opposed to

data: '/pos/assets/img/header-logo.png'

?

Kind regards,

Lite Finocchiaro
VP, QZ Industries

--
You received this message because you are subscribed to the Google Groups "qz-print" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qz-print+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/qz-print/c172278a-7b4f-4a97-be13-4aa0e870aa42n%40googlegroups.com.

Tres Finocchiaro

unread,
Mar 21, 2025, 11:04:45 AMMar 21
to Lite Finocchiaro, Ray Han, qz-print
You may also want to try base64.  You can drag the image onto our demo page to test this out quickly.

https://demo.qz.io (drag the image right onto the demo page)

-Tres



Ray Han

unread,
Mar 22, 2025, 7:44:09 PMMar 22
to qz-print
Hi Lite and Tres,

Appreciate your responses.
I tried using Edge browser and setting a full url, but neither worked. However, Tres' suggestion did. I dopped the image onto the demo page and clicked 'Print dropped "header-logo.png"' button and it printed sucesssfully.
This confirms that the issue was indeed a permision-related error (403) as indicated in the error message. However, I am still unsure why this is happening, given that all permissions and security settings correctly configured and the image displays fine in web browsers.
I'd love to understand what might be causing this if you have any thoughts. I am using QZ Tray v2.1.2.

Kind regards,

Ray

Tres Finocchiaro

unread,
Mar 23, 2025, 2:55:48 AMMar 23
to Ray Han, qz-print
I'd love to understand what might be causing this if you have any thoughts. I am using QZ Tray v2.1.2.

If everything else looks fine, there are generally three causes:
  • Proxy (Java doesn't work well with automatically configured proxies)
  • Antivirus Software
  • User Agent String (some websites restrict certain user agent strings to prevent non-browsers from accessing content)
In most cases, switching the code to base64 is more resilient because it circumvents all three potential causes.




Ray Han

unread,
Mar 25, 2025, 4:22:47 AMMar 25
to Tres Finocchiaro, qz-print
Hi Tres,

I ended up converting the image file to base64 as you suggested.
Thanks for your help.

Kind regards

Ray

Reply all
Reply to author
Forward
0 new messages