# Simple printing using JS Print Setup not working

**URL:** <https://discourse.mozilla.org/t/simple-printing-using-js-print-setup-not-working/7822>\
**Category:** Add-on Support\
**Created:** [March 29, 2016, 11:32pm UTC](https://discourse.mozilla.org/t/simple-printing-using-js-print-setup-not-working/7822 "2016-03-29T23:32:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![m.hamdy](https://avatars.discourse-cdn.com/v4/letter/m/f19dbf/32.png) [@m.hamdy](https://discourse.mozilla.org/u/m.hamdy)\
**Post date:** [March 29, 2016, 11:32pm UTC](https://discourse.mozilla.org/t/simple-printing-using-js-print-setup-not-working/7822/1 "2016-03-29T23:32:22Z")

</div>

I’m trying to do printing from my addon, using [JS Print Setup](https://addons.mozilla.org/en-US/firefox/addon/js-print-setup/) as a dependency. I’m using the addon SDK and the jpm tool.

I’m basically using a **page-worker** to format an HTML page and print in the background.

It works on a development machine when selecting the **Microsoft Print To PDF** printer and the pdf is printed (more like exported) fine.

Now on the real thing, printer **Zebra 3x1** it prints blank pages.

Here’s a [sample extension that exhibits the problem](https://www.dropbox.com/s/uqj9mu7g1u6iqkz/%40printtest-0.0.1.xpi?dl=0).

And here’s how it works:  
0 - You need to enter a printer name from your machine into the **printerName** variable in **data/to\_be\_printed.html** file.

Here’s an excerpt:

```
        addon.port.on("print", fillPrintHTML);
        var printerName = "Zebra 3x1"; // or put your own printer here, or lend my yours, I don't have one.

    function fillPrintHTML() {
        $("#label-container span").text("My Text That Should Be Appended But Doesn't For Some Reason Can You Help Me?");
        setTimeout(function() {
            doPrint();
        }, 100);
    }`

```

**Your target is on the second line**  
calling _jsPrintSetup.getPrintersList()_ on your Firefox’s console should give you hints of printer names available for you.

1- Install [JS Print Setup](https://addons.mozilla.org/en-US/firefox/addon/js-print-setup/) (probably on a [custom profile](https://support.mozilla.org/en-US/kb/profile-manager-create-and-remove-firefox-profiles)), then the addon. A word of **warning** : [JS Print Setup doesn’t work on OS X] ([https://www.mozdev.org/bugs/show\_bug.cgi?id=22369](https://www.mozdev.org/bugs/show_bug.cgi?id=22369)) .

2- Click the addon’s green button on the toolbar, it opens **[google.com](http://google.com)** in a new tab.  
3- Refresh the tab a couple of times, approving the addon’s permission to print.  
4- Thank you for reading up to here!

Does it print? Does it not? and is there anything I’m doing wrong?

---

<div class="post-metadata">

**Author:** ![m.hamdy](https://avatars.discourse-cdn.com/v4/letter/m/f19dbf/32.png) [@m.hamdy](https://discourse.mozilla.org/u/m.hamdy)\
**Post date:** [March 29, 2016, 11:50pm UTC](https://discourse.mozilla.org/t/simple-printing-using-js-print-setup-not-working/7822/2 "2016-03-29T23:50:25Z")

</div>

Here’s how it should look like [[pdf capture](http://i.imgur.com/f1meudr.jpg?1) ]
