Click here to Skip to main content
16,021,823 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have to send a priter command for changing font from VB.NET.
And i am using RawprinterHelperClass and sendstringtoprinter(printername,stringname) function to print a string.
I have Printer Command but i donot know to send it. Printer Command is

CSS
Font Selection
-----------------------------------------------------------------------------------
    ASCII       Dec Hex Description
-----------------------------------------------------------------------------------
    ESC k n     107 6B  Select Typeface
                    n=0: Roman      4: Script
                      1: Sans Serif        10: Roman T
                      2: Courier           11: Sans Serif H
                      3: Prestige
------------------------------------------------------------------------------------

Please help me
Posted
Updated 26-Sep-12 22:56pm
v2

1 solution

Have you tried OpenPrinter[^] and WritePrinter[^].

Check this[^]. There's a sample code available.
 
Share this answer
 
Comments
Shanmugam Vasu 27-Sep-12 5:13am    
Thanks for your reply. I am using the same coding which you gave as sample code. I want to know string format for printer commands.
ex: s=chr(12) (for Form Feed) likely how i have to sent for changing font
Malli_S 27-Sep-12 5:23am    
In that case you can create the byte stream of the command and send it.
Shanmugam Vasu 27-Sep-12 5:27am    
Please guide me, how create and send bytestream for commands.
Malli_S 27-Sep-12 5:40am    
From the above link use SendBytesToPrinter() function and specify the command string you want to send to the printer.
Shanmugam Vasu 27-Sep-12 6:11am    
i am unable to get it, mycode is(to change the font to script)
s="ESC k 4"
RawPrinterHelper1.SendBytesToPrinter(pd.PrinterSettings.PrinterName, s, s.Length)

please Correct me

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900