How do I set printer's paper size? (setPaperSize does not work)

1,679 views
Skip to first unread message

Alex Begg

unread,
Oct 1, 2013, 8:44:07 PM10/1/13
to jzebra...@googlegroups.com
I am printing a PDF (so a PostScript print) to a Brother QL-700 Label Printer. At first I thought applet.setPaperSize would set the print job's paper size for the printer, but for me it just changed the size of the image printed, and did not change the printer's paper size.

The printer has 1.1" x 3.5" as the default paper size, but the paper loaded into the printer is 2.4" x 3.9" labels. When I print the printer's print dialog comes up showing the paper size as 1.1" x 3.5" with an error about it being wrong size paper.

When I manually change the paper size in the printer's printing preferences to 2.4" x 3.9", then it prints successfully.

Is there a way to set the printing preferences before a print using jzebra without having to instruct each user how to change their printing preferences inside of control panel's Devices and Printers?

Tres Finocchiaro

unread,
Oct 1, 2013, 9:34:00 PM10/1/13
to jZebra users
Alex,

There may be.  The applet is used vastly for label printers that support raw languages (such as Zebra printers) where the print commands are supplied as human readable ASCII commands (font size, position, etc.)  I bought a used LP2844 label printer for $150 so they're fairly inexpensive to develop against and automatically feed to the next label, etc.

Your use of the PostScript features on such a small label printer is really exploiting a feature a bit further than it was originally intended for.  PostScript support was primarily a fall-back for web services that were forced to offer a LaserJet alternative.  The little I've dealt with the "2D" side of Java's printing has been terrible.  For example, Portrait vs. Landscape isn't honored the same on all devices. Reverse Landscape is even worse, and the "Copies" parameter simply does nothing in my tests.  This has made the PostScript features really fall behind the rest.

The good news is this isn't the first time someone's tried to do advanced printing using Java, so I'll offer you this, if you can find some code examples of others doing what you are describing using Java I'll be happy to implement those changes and send you the beta version for testing.

-Tres

--
--
To unsubscribe from this group, send email to jzebra-users...@googlegroups.com
 
http://code.google.com/p/jzebra
 
---
You received this message because you are subscribed to the Google Groups "jZebra users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jzebra-users...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Alex Begg

unread,
Oct 1, 2013, 11:24:37 PM10/1/13
to jzebra...@googlegroups.com
I am aware of using raw printers with jZebra, I successfully got an EPSON TM-T20 receipt printer working using ESC/P commands. However when I attempt to get the Brother QL-700 commands working I got confused. First I read that I need to: 1. Open USB/Serial/Network port (my case, USB). 2. Check machine status. 3. Send print data. 4. Confirmation of printing completion. 5. Close USB/Serial/Network port. How do I do all of that with jZebra? This was not as simple as the receipt printer in which I just appended all the commands and sent it to the printer and it prints out instantly. I did read something that most of the Brother label printers only accepts Raster command control, I don't know if that makes a difference? So for me, PostScript just simply worked, so that why I am using it. Also, I don't know if it matters, but the labels I am printing is a custom design that has custom fonts, QR Codes, and images. So that is why I am using PDF printing. I am generating the PDF using FPDF in PHP.

Here is the command reference I am using for the Brother: http://download.brother.com/welcome/docp000678/cv_qlseries_eng_raster_600.pdf
Here is something listing the types of command controls used for each, with QL-700 in the list: http://www.brother.com/pub/dev/pdf/label_printer_dev_map.pdf

Tres Finocchiaro

unread,
Oct 2, 2013, 12:04:43 AM10/2/13
to jZebra users
Alex,

Thanks for that very useful link.

The bottom of page 18 says some printer models actually support ESC/P modes, but the QL-700 doesn't appear to be on that list.

jZebra is normally a one-way communication, so you'd have to rely on the OS (i.e. Windows) to open the port, send data, close the port, which it's already doing for the other manufacturers as part of its standard printing functionality.

As far as checking for successful completion, that's not possible without 2-way communication, although the print spooler may receive some basic completion events by default.

The Brother manual doesn't really explain very well what "raster" mode or how to use it, but that looks like a very attractive option if we can see some code (even in another language perhaps) that utilizes it.  That's how we're implementing graphics on Epson (working on it right now actually) by porting some C# code over to Java.

-Tres
Reply all
Reply to author
Forward
0 new messages