-
×InformationNeed Windows 11 help?Check documents on compatibility, FAQs, upgrade information and available fixes.
Windows 11 Support Center. -
-
×InformationNeed Windows 11 help?Check documents on compatibility, FAQs, upgrade information and available fixes.
Windows 11 Support Center. -
- HP Community
- Archived Topics
- Printers Archive
- Re: How to send print command to printer?

Create an account on the HP Community to personalize your profile and ask a question

12-01-2016 06:04 AM
I want to send print commands to printer which can print a sample message provided by me.
I am looking for basic PCL3 command set for printing.
I tried Escz command also but it's not working.
Please provide me some example commands set .
12-01-2016 02:42 PM
Hello, @P_1 – Greetings!
Welcome to the HP Forum! This is a wonderful location to converse with the community, get assistance and find tips.
Going through your post, I am not very clear on what operating system you working on. You have mentioned "Other" in OS field. Are you using Linux / Unix or some other OS?
If you are using Linux / Unix, these links might be of your assistance:
Link 1: http://hp.care/2fL7kAv
Link 2: http://hp.care/2fL7l7f
If you are using Ubuntu, try the steps here: http://hp.care/2h06iRa
Please let me know if this resolves the issue, or if you require further assistance.
Cheers 🙂
Please click "Accepted Solution" on the post that solves your issue to help others find the solution. To show appreciation for my help, please click the "Thumbs Up Icon" below!
DVortex
I am not an HP Employee
12-01-2016 09:58 PM
Hi,
Greetings.
I am working on a medical embedded device. I have interfaced a printer and able to read DeviceID and port status.
But i am not able to send commands to printer. Normal c- language i am using. I tried to send few commnds but unable to print.
I tried following commands:
"LB""Any Message""\003;"
#define ESCAPE "\033"
#define COMMAND_JOB_START ESCAPE "%-12345X" ESCAPE "E" ESCAPE "&l0E" ESCAPE "&l0F" ESCAPE "&a0L" ESCAPE "&a0M"
#define COMMAND_JOB_STOP ESCAPE "E" ESCAPE "%-12345X"
Please tell me the right way to use these commands.
I want to print any sample message.
best regards
12-02-2016 05:25 AM
I think you are over engineering things right now.
Consider...
printf("%dEmy mesage%dE",27,27);
The output of the printf should print "my message" on a PCL3 printer when sent to the printer port. Once you get that to work, we can point you to suitable formatting and font commands. This will likely print in Courier 10 pitch.
12-02-2016 05:43 AM
Hi ,
I tried using simple commands like :
"LB""Any Message""\003;"
or
Escz ("\033""z")
I have also tried:
char buffer[50] = "Print sample message\n";
buffer value sent to bulkout buffer.
If I am doing something wrong, please guide me.
Thanks & Regards.
12-02-2016 06:13 AM
The DeskJet 200 (J210) series printers use the PCL3GUI Page Description Language.
As far as I can make out, this language is raster-based, using proprietary raster-compression algorithms.
So I doubt that it will understand plain ASCII text (but I could be wrong - I don't have access to such a printer to conduct any tests).
Attached is a .zip file containing a 'capture' of the 'testprint' job generated by the (Windows 10 Pro 64-bit) 'class' driver associated with this printer model; also within the zip file is an analysis of that print job.
Points of interest from the analysis:
- The job starts with 18000 <NUL> (0x00) bytes; I think that these are used to cause the printer to flush its buffers of any remaining data before the job starts.
- The job proper then starts with a Universal Exit Language escape sequence (which causes the printer to enter PJL mode).
- Ths is followed by a number of PJL commands, the last of which is a PJL ENTER LANGUAGE = PCL3GUI command (which should cause the printer to initialise the PCL3 GUI interpreter).
- This ENTER LANGUAGE command is then followed by further PJL commands - but these will be treated as data and 'printed' (or not), since the device is no longer in PJL mode (so looks like a driver bug!).
- There are then a few PCL initialisation escape sequences (to set paper size, orientation, plex mode, etc., as well as some related to device-specific (proprietary) 'driver' and 'raster' configuration data).
- The remainder of the job appears to be a series of (compressed?) raster-data images.
12-02-2016 04:42 PM
After a bit of searching I found a document that confirms the Deskjet 2000 is indeed a PCL3gui ONLY printer. So @P_1 you should find another printer for this application. I would look for a PCL5 LaserJet, but a DeskJet that supports real PCL3 will be adequate. Good luck!
12-02-2016 09:27 PM
Hi Everyone,
Greetings.
Thanks to all for your support.
Definitely I would go for PCL5 Laserjet printer. Even I have tried Laserjet printer as well. Strange thing I observed that Laserjet printer was detected as a Mass Storage Class device, I have also confirmed with USBlyzer tool.
My question is still: Can I get a sample message print by any commands using Deskjet 2000 ?
Likewise I have mentioned above, just to make sure that my approach is right in sending data to BulkOut endpoints.
Or any command I could send to printer and get any responses.(Reset or self-test) . I tried different commands but didn't get responses from printer. 😉
I would go for PCL5 anyways.
Best Regards.
