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 8207007
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T08:51:53+00:00 2026-06-07T08:51:53+00:00

I need to send content to printer in C# .NET the same way as

  • 0

I need to send content to printer in C# .NET the same way as PRINT command does.

I have Godex thermal printer with QLabel software bundled. Now it has the option to save the label as a command that you can pass to printer with command prompt PRINT command. The file looks like this:

^Q80,3
^W100
^H10
^P1
^S3
^AD
^C1
^R2
~Q+0
^O0
^D0
^E35
~R200
^L
Dy2-me-dd
Th:m:s
AH,0,0,1,1,0,0,X
AH,744,0,1,1,0,0,X
AH,746,560,1,1,0,0,X
AH,0,550,1,1,0,0,X
AG,160,208,1,1,0,0,
AA,234,283,1,1,0,0,Haloo
E

That works when i do something like this:

net use LPT2 \\localhost\godexUsbPrinter /yes
print /D:LPT2 label.cmd

And it prints my label out nicely.

Now, if i open this in notepad and print, it just prints me this text.

I wonder what does PRINT command do under the hood and how can i program my C# based program to replicate the behaviour? Because when i implement printing logic, it just prints me the plain text as notepad does.

I know i could call a PRINT command with Process.Start from C#, but i need to replace some placeholder value in the label template all the time. I could create a temporary file on the disk and print that, but i would prefer to avoid such a scenario.

  • 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-06-07T08:51:56+00:00Added an answer on June 7, 2026 at 8:51 am

    To be honest, the question title is the wrong way around. PRINT doesn’t do anything spectalular at all, it just flushes all its input to the printer. It’s Notepad that, through Windows’ print system, sends various commands for paging and line endings and whatnot and eventually the data you want to print. The code you show is raw printer data, so you’ll have to send it ‘raw’ and not as text. So technically it’s a duplicate of this question.

    How to do so is explained here. It’s using P/Invokes to winspool.Drv.

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

Sidebar

Related Questions

I need to be able to send the content type text/xml to Firefox and
I have a file, and I need to send its contents to a function.
I have this need to place my app in the share/send context menu so
I need to send instant messages (like forum PMs) between users with my asp.net
Hey guys I need to send the content of an NSMutableArray through email. I
Lets say that i need to send about 5000 email with different content dailly
I need to send a text content of an HTML node over Ajax request,
I need to send the content of a file to a Spring webService with
i have a situation where i need to send an email with attachment using
For example if we need to send content which is in this format ,

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.