Chrome Direct Print (Web App Usage)

“Chrome Direct Print” is abandoned in favor of “WebApp Hardware Bridge
Which support all modern browsers (Chrome, Firefox, Edge),
with better compatibility, performance and serial port support.

Example Usage to call “Chrome Direct Print”
If the extension is not installed, it will fallback to view the PDF.

<!DOCTYPE html>
        <link rel="chrome-webstore-item" href="">

        var url = '';
        var type = 'RECEIPT';

        function directPrint() {
            var evt = document.createEvent('CustomEvent');
            evt.initCustomEvent('chromeHardwareEvent', true, false, {action: 'print', type: type, 'url': url});

        function downloadPDF() {
            document.location.href = url;

        function start() {
            var testImage = document.createElement("img");
            testImage.setAttribute("onload", 'directPrint()');
            testImage.setAttribute("onerror", 'downloadPDF()');
            testImage.setAttribute("src", "chrome-extension://fnfkcaeloalplnglklappfjfjeafakeo/icon-128.png");

        setTimeout(start, 100);

6 Replies to “Chrome Direct Print (Web App Usage)”

  1. Getting Error
    “Chrome Direct Print
    Failed to connect to host:Error when communicating with the native messaging host

    Have you installed host?”

    I have installed host….

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.