Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HP pcl codes 1

Status
Not open for further replies.

sreb

Technical User
Nov 28, 2003
2
GB
HI, iam having trouble with the following PCl code, it works ok using copy /b pcl.txt lpt1 in dos

<esc code 27 >%-12345X@PJL DEFAULT PAPER=A4
@PJL SET SERVICEMODE=HPBOISEID
@PJL SET PAGES=13860
@PJL SET SERIALNUMBER=FRFRG12345
@PJL SET SERVICEMODE=EXIT
@PJL RESET
<esc code 27>%-12345X

but i want to write a program in c , and use inputs from the keyboard for the serial number, page count and lanugage, but using the following program in c, it doesnt work, it prints 11d or some other text.

/*
* ======================================
*/

#include <stdio.h>

main()
{


clrscr();
cprintf(&quot;HP Pcl test program\r\n&quot;);
fprintf(stdprn, &quot;\033%-12345X@PJL&quot;
&quot;@PJL SET SERVICEMODE=HPBOISEID&quot;
&quot;@PJL SET PAGES=13860&quot;
&quot;@PJL SET SERIALNUMBER=FRFRG12345&quot;
&quot;@PJL SET SERVICEMODE=EXIT&quot;
&quot;@PJL RESET&quot;
&quot;\033%-12345X&quot;);
}

/*
* end of main()
*/


PLS anyone have any ideas why the c program doesnt work the samre way as the dos program above!??

regards mark S
 
printf(&quot;%c%%-12345X&quot;,27);


print the escape as %c with a value of 27

You have to print %% to get a single percent sign.

Jim Asman
jlasman@telus.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top