Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7523615
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T02:51:17+00:00 2026-05-30T02:51:17+00:00

I am creating a java application that retrieves a userId from a database, transforms

  • 0

I am creating a java application that retrieves a userId from a database, transforms it into a barcode, then sends it to a printer. I am planning to use a Zebra printer and I was wondering if anyone has experience of printing to a Zebra printer from a Java application; if so, could you share some code making this possible?

Thanks in advance,
Tumaini

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T02:51:18+00:00Added an answer on May 30, 2026 at 2:51 am

    There are two ways to work with Zebra printers. The first is to print as on regular printer. Java printing basics are well explained in official tutorial. End of page will treated by printer as end of sticker. The disadvantage of this approach is that all painting must be done by hands. I.e. you can’t use internal printer’s barcoding ability.

    The second is to write ZPL commands directly to printer. Something like this:

    PrintService pservice = ... // acquire print service of your printer
    DocPrintJob job = pservice.createPrintJob();  
    String commands = "^XA\n\r^MNM\n\r^FO050,50\n\r^B8N,100,Y,N\n\r^FD1234567\n\r^FS\n\r^PQ3\n\r^XZ";
    DocFlavor flavor = DocFlavor.BYTE_ARRAY.AUTOSENSE;
    Doc doc = new SimpleDoc(commands.getBytes(), flavor, null);
    job.print(doc, null);
    

    The disadvantage is that you need to learn ZPL – Zebra Programming Language. Although it is simple enough, but such things as images and custom fonts could make you headache. Programming manuals are freely available on Zebra site: Part 1 and Part 2.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am new to Documentum. I am creating a stand alone java application that
I've creating a Java Swing application and I realized that I have many many
I'm currently creating a fullscreen Java application that will be like a kiosk application.
I am creating database Entities in my Java application and trying to rationalize between
I am creating a java application that connects to multiple databases. A user will
I'm creating a Java application in NetBeans, and I have the following code that
I am creating a map application that receives a list of coords from a
I'm creating a Java application that uses Hunch's API , but the problem is
I am creating a Java Desktop Application that is going to have a Firewall.
I have a Java application that I want to turn into an executable jar.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.