1. Tracy Lamb
  2. PowerBuilder
  3. Thursday, 26 October 2023 15:42 PM UTC

In PB, I have a print feature to print a string directly to a Zebra label printer.  The string includes Escape characters with formatting commands. It works great in my PB app.

ll_job = PrintOpen("Label",TRUE)
li_rc = Print(ll_job, ls_ZPL)
li_rc = PrintClose(ll_job)

I'm just wondering if there's a C# equivalent?  I'd like to write an independent C# program to print labels.

~~~Tracy

Francisco Martinez @Appeon Accepted Answer Pending Moderation
  1. Thursday, 26 October 2023 16:47 PM UTC
  2. PowerBuilder
  3. # 1

Hi Tracy,

There's not an "equivalent" in the sense that you can get a print out by only specifying 3 lines of code. However, it is definitely possible to print in C#, however the process is a bit more involved (how involved depends on the approach you take) and you won't be able to get through it without writing C# manually.

 

The following is an old tutorial that makes the process as simple as can be:

https://andres.jaimes.net/71/printing-in-csharp-the-easy-way/

Hopefully it can help you measure more or less how not-as-easy it is.

 

Regards,
Francisco

Comment
  1. Tracy Lamb
  2. Thursday, 26 October 2023 18:01 PM UTC
Thanks for your response Francisco. Unfortunately, the tutorial your shared causes the string to print as a drawing object, which is standard practice with modern printers. Everything is a graphic. I need to send the raw string as the Zebra printer only receives a string with a start sequence (^XA) and an end sequence (^XZ), Then it parses everything in between for label formatting commands. The data for the label is embedded in the string.

~~~Tracy
  1. Helpful
  1. Francisco Martinez @Appeon
  2. Thursday, 26 October 2023 18:04 PM UTC
If the printer can be accessed through Serial protocol you can do that relatively easily in C#
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.