Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Label printing with c#

Label printing with c#

Scheduled Pinned Locked Moved C#
questioncsharp
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    candogu
    wrote on last edited by
    #1

    Hello, I want to write a C# label print application. My printer is Zebra P4T. My label size is 3x3 cm one column one row. I tried some libraries, RawPrinterHelper class etc. but they didn't fit. What is your advice to start with? Thanks.

    OriginalGriffO Richard DeemingR C 3 Replies Last reply
    0
    • C candogu

      Hello, I want to write a C# label print application. My printer is Zebra P4T. My label size is 3x3 cm one column one row. I tried some libraries, RawPrinterHelper class etc. but they didn't fit. What is your advice to start with? Thanks.

      OriginalGriffO Offline
      OriginalGriffO Offline
      OriginalGriff
      wrote on last edited by
      #2

      Try the PrintDocument class: it lets you position and size things exactly as you wish. PrintDocument Class (System.Drawing.Printing)[^]

      Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...

      "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
      "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

      1 Reply Last reply
      0
      • C candogu

        Hello, I want to write a C# label print application. My printer is Zebra P4T. My label size is 3x3 cm one column one row. I tried some libraries, RawPrinterHelper class etc. but they didn't fit. What is your advice to start with? Thanks.

        Richard DeemingR Offline
        Richard DeemingR Offline
        Richard Deeming
        wrote on last edited by
        #3

        To print to a Zebra printer, you'll need to combine the RawPrinterHelper class with ZPL commands: ZPL2 Programmers Manual[^] Here's the class I use[^] - just call RawPrinterHelper.SendStringToPrinter(zplPrinterName, zplDocument, null) to send the specified ZPL commands to the printer. This tool[^] lets you preview your ZPL document online, although you might find some subtle differences between the tool and your printer.


        "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

        "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

        1 Reply Last reply
        0
        • C candogu

          Hello, I want to write a C# label print application. My printer is Zebra P4T. My label size is 3x3 cm one column one row. I tried some libraries, RawPrinterHelper class etc. but they didn't fit. What is your advice to start with? Thanks.

          C Offline
          C Offline
          cinias
          wrote on last edited by
          #4

          There are some options to do it. One is that with Zebra printers you are receiving also software to create labels fe. Zebra Designer. You can create tamplate in this software, save it as text file (it will be ZPL language) and in your application you will read this template then you will do string replace with your data and send it all as text to the printer. Other option is to generate pdf file in your app and send pdf file with your label to printer. But printer will need to support it.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups