Print sticker/barcode label directly from browser on a (zebra) printer

22,172

Solution 1

I do exactly this but due to the limitations of web based stuff cannot control the windows print interface without either firing a java or an activex based sub app I have had to have the web browsers set to print to the dymo printers.

Now I enforce the usage of firefox which means I have a custom install bundle of firefox that sets the margins to zero, turns off headers and footers, selects the right printer and paper and landscape etc (I only did a custom bundle because I had 100+ pc's to configure if its only a few its a 60 second change job to do it manually). The advantage of enforcing firefox is that FF allows you to select and set as the default printer a different printer to the system default. So in my case ff is set for dymo's the system printer is set as the kyocera's so nothing gets lost/set etc outside of firefox.

As for generating the barcode I just create a basecode as a jpg on the fly display the jpg in a new popup window and use a little javascript to automatically popup the print box so all the user has to do is click ok. Its impossible to do this without user input!

Unfortunately there's no easy way so close the window as there's no return event trap from the system print spooler/drivers back into the web browsers (they're sandboxed from each other for obvious reasons!) so the best you can do is implement a timed close after xxx seconds.

Short of it though is there's no easy way to do this with no user input and without making a few compromises. Now if cash and time is of no issue to you I do have a proper way of doing it fully automated etc but its a big job

Solution 2

We just use an FTP (used to use windows, now use whats built into cold fusion, but any would do) and you send the zebra printer the definition of your barcode to the machine that way... anything that can open up such a channel and send the code to the printer will work.. so if you want to do it with javascript see how fireftp does it... then use that... or you can send info in ZPLII coding... that tells it how to print.

Share:
22,172
user2031649
Author by

user2031649

Updated on July 09, 2022

Comments

  • user2031649
    user2031649 almost 2 years

    We have to following situation, for one of our clients we are looking for a solution. He has build an PHP script that generates a label with some info and barcodes on it, so the workflow is as discribed : User put in some data ( some is data is pulled from the database, some not )

    When the user clicks on print label, a windows opens and the label is generated. So now the code ( i guess javascript can do the job ) must do the work. The client wants that when the user clicks on ok ( or print label ) the label will be printed and the window will close without any interuption from a user.

    Possible solution : http://dymodevelopers.wordpress.com/2010/06/02/dymo-label-framework-javascript-library-samples-print-a-label/

    So in fact :

    1. The script must select the right printer ( not the default one )
    2. Script must select the right format ( landscape/portrait and sizes of the labels )
    3. Must be printed without user interuption.
    4. Window must close automatic after printing the label.

    Thanks for the help ;)