From PHP application to print wristband labels trought serial port

512 views
Skip to first unread message

giovanni...@gmail.com

unread,
Mar 14, 2014, 9:58:10 AM3/14/14
to qz-p...@googlegroups.com
I'm using a PHP framework called Scriptcase. I don't know if you ever heard it.
Becouse I'm not a programmer it's very useful for me.

Now I have a php grid with selected data by a filter and once displayed the result data I have to send them to a wristband labels printer .
I'm wondering if using a specific class or other stuff can I fill the gap ?

I can produce a query with all text data and one barcode fields as input stream.

Many thanks
Giovanni

Tres Finocchiaro

unread,
Mar 14, 2014, 10:16:57 AM3/14/14
to giovanni...@gmail.com, qz-p...@googlegroups.com
@Giovanni,

It's not very often the mailing list deals with non-programmers, so "to fill the gap" (in your words) could prove to be quite the challenge.

There are a lot of details you'll need to know about both Scriptcase as well as your printing needs:
  1. Does Scriptcase allow custom HTML (so we can embed this plugin)
  2. Does Scriptcase allow custom JavaScript (so we can fire the proper print() actions to the plugin)
  3. What type of printer?  Will you choose to use Raw or PostScript style printing?
    Raw would be a series of text commands that get translated by the printer where PostScript would be sending an already prepared document to the printer.
    See http://qzindustries.com/WhatIsRawPrinting for more information
  4. Do you have a budge and timeline and need professional services?  If so, you may consider contracting this feature.
Your answers to these questions would get us started but depending on your expertise level, you may find yourself in over your head.  From my understanding there isn't yet a "canned" Scriptcase module that is compatible with our plugin.  If this is your desired goal, you should probably see if some Scriptcase maintainers would be willing to contract this feature and I would be happy to work with them on this.

-Tres


G.Chiozza - Gmail

unread,
Mar 14, 2014, 10:39:20 AM3/14/14
to Tres Finocchiaro, qz-p...@googlegroups.com
Hi Tres,
thanks for prompt reply.
Your answer seems very  detailed but unfortunately for me it's like arabic...  ;-))
Printer is something like that : http://www.zebra.com/gb/en/products-services/printers/printer-type/desktop/hc100.html or
http://label-printers.findthebest.com/compare/194-274/Sato-CG212-vs-Zebra-R2844-Z
Scriptcase is a PHP framework so it can arrange everything in that environment (also additional classes) and it also have the possibility to use Javascript.

Output has also a barcode



Tres Finocchiaro ha scritto:

giovanni...@gmail.com

unread,
May 30, 2014, 10:42:53 AM5/30/14
to qz-p...@googlegroups.com, giovanni...@gmail.com
I did some improvments... and I did the job using the SATO CT408i thermal printer.
The last php line call a .bat file that makes the following cmd command.
copy "path\\myfile.prn" "\\My_pc_name\SATO CT408i". Everything it was OK.
The customer said... I avoid to use anything that is shared !!!
Now I'm still here to ask help.

I did this code:
<?php
$file_to_print = "C:\\inetpub\\wwwroot\\Test\\test_sato.prn";
$content_file_to_print = file_get_contents($file_to_print);
$handle = printer_open("SATO CT408i");
printer_set_option($handle, PRINTER_MODE , "RAW");
printer_write($handle, $content_file_to_print);
printer_close($handle);
?>

but the file goes to the spooler and stay there .... forever. Nothing happen and all is stucked there.

I want to try to use qz_print but I do not understand how install it and what it does. Should it to send the raw file without the needing of sharing the printer ?
Many thanks
Giò

Tres Finocchiaro

unread,
May 30, 2014, 11:06:48 AM5/30/14
to Giovanni Chiozza, qz-p...@googlegroups.com
qz-print loads using Java as an HTML element in the web page, similar to a flash plugin.

You add it to your page with html tags like this:
<applet> ... some stuff </applet>

The path of the JAR and JNLP files to be accessible similar to how an image HREF would be accessible.

Once that's done you will use JavaScript to send the PRN file over to the printer.

You'll be doing something like this:
   qz.appendFile("file:///C/inetpub/wwwroot/Test/test_sato/myfile.prn");

Long term this will look something more like this:
   qz.appendFile("http://mysite/test_sato/myfile.prn");

Depending on your experience with running a web server and which server-side language you are using will dictate how much skill is needed to fulfill this request.

These instructions are spelled out on our old web tutorial located here. We haven't rewritten this for our new website yet.

-Tres

--
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.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages