borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (Data Report - Date Type field)Next Topic (Printing a receipt from list) New Topic New Poll Post Reply
AndreaVB Forum : Printing : Printing in different language in dos mode with VB
Poster Message
lakki_lakki
Level: Guest


icon Printing in different language in dos mode with VB

Hi, anyone of you know what do if a vb program is not printing, local language words. It prints everything but not those words. So please help me.

Yeah of coz, printer does support those words, and it does print norwegian words from any other program. So nothing wrong with the printer...


Regards
lakki

[Edited by lakki_lakki on 04-05-2004 at 04:12 PM GMT]

04-05-2004 at 08:59 AM
| Quote Reply
stickleprojects
Level: Moderator


Registered: 09-09-2002
Posts: 891
icon Re: Printing in different language in dos mode with VB

Hi lakki,
The title of your question suggests that you are printing to STDOUT or some-such from VB.
If so,
Windows was created (amongst other reasons) to provide a standard method for programmers to control printers and graphics...
Therefore,
You need to send special control characters to your printer from DOS mode in order for it to print the norwegian character-set.
You will need to obtain these codes from your manual or the manufacturer... good luck! ;)

Kieron


____________________________
Build it better, faster, quicker, easier.. then fix it (non-offical MS mission statement)

04-05-2004 at 11:11 PM
View Profile Send Email to User Show All Posts | Quote Reply
lakki_lakki
Level: Guest

icon Re: Printing in different language in dos mode with VB

Hi, take a look on the code below which we are using to print..
Now we have to use the manual or manufacturer what do you mean by that..

Next we tried to make a funtion to map characters, mean to convert it. But does not work it either..

Now tell me how to send those special control characters...??
thanks anyway..


Open "printer.bat" For Output As #3

'ActualPrint just to check on the screen

Print #3, "Type " & Chr(34) & "ActualPrint.dat" & Chr(34 & " >> PRN"

Close #3
'    For i = 1 To 2
    Shell "printer.bat", vbHide

that's how we are doing...prints fast

05-05-2004 at 08:50 AM
| Quote Reply
steve_w
Level: Moderator


Registered: 18-04-2003
Posts: 1156
icon Re: Printing in different language in dos mode with VB

Hi Lakki

To give you an idea what Kieron meant, below is a list of the control codes for the HP Laserjet
HP LASERJET/LASERJET PLUS/SERIES II SETUP STRINGS
=================================================

CONTROL CODES AND |
ESCAPE SEQUENCES | DEFINITION
----------------------------------|-----------------------------------------
BS (ASCII 8/HEX 08) | BACKSPACE
CR (ASCII 13/HEX 0D) | CARRIAGE RETURN
ESC (ASCII 27/HEX 1B) | ESCAPE
FF (ASCII 12/HEX 0C) | FORM FEED
LF (ASCII 10/HEX 0A) | LINE FEED
SI (ASCII 15/HEX 0F) | SHIFT IN
SO (ASCII 14/HEX 0E) | SHIFT OUT
|
<ESC>&F#S | PUSH/POP POSITION
<ESC>= | HALF LINE FEED
<ESC>&10O | PORTRAIT ORIENTATION
|
<ESC>&a#C | HORIZONTAL CURSOR POSITIONING (COLUMNS)
<ESC>&a#H | HORIZONTAL CURSOR POSITIONING (DECIPOINTS)
<ESC>&a#L | LEFT MARGIN
<ESC>&a#M | RIGHT MARGIN
<ESC>&a#R | VERTICAL CURSOR POSITIONING (LINES)
<ESC>&a#V | VERTICAL CURSOR POSITIONING (DECIPOINTS)
|
<ESC>&d@ | DISABLE AUTO-UNDERLINING
<ESC>&dD | ENABLE AUTO-UNDERLINING
|
<ESC>&f#S | PUSH/POP POSITION
<ESC>&f#X | MACRO CONTROL
<ESC>&f#Y | MACRO ID
|
<ESC>&k#G | LINE TERMINATION
<ESC>&k#H | HORIZONTAL MOTION INDEX (HMI)
<ESC>&k#S | FONT PITCH (PRIMARY AND SECONDARY)
|
<ESC>&l#C | VERTICAL SPACING (VMI)
<ESC>&l#D | VERTICAL SPACING (LPI)
<ESC>&l#E | TOP MARGIN
<ESC>&l#F | TEXT LENGTH
<ESC>&l#H | PAPER INPUT CONTROL
<ESC>&l#P | PAGE LENGTH
<ESC>&l#X | SELECT NUMBER OF COPIES
|
<ESC>&l0L | DISABLE PERFORATION SKIP MODE
<ESC>&l1L | ENABLE PERFORATION SKIP MODE
<ESC>&l1O | LANDSCAPE ORIENTATION
|
<ESC>&p#X[transparent print data] | TRANSPARENT PRINT DATA
|
<ESC>&s0C | ENABLE WRAP-AROUND MODE
<ESC>&s1C | DISABLE WRAP-AROUND MODE
|
<ESC>(#@ | PRIMARY FONT DEFAULT
<ESC>(#X | DESIGNATE DOWNLOADED FONT AS PRIMARY
|
<ESC>(0A | MATH SYMBOL SET (PRIMARY)
<ESC>(0B | LINE DRAW SYMBOL SET (PRIMARY)
<ESC>(0U | USASCII SYMBOL SET (PRIMARY)
<ESC>(8K | KANA-8 SYMBOL SET (PRIMARY)
<ESC>(8U | ROMAN-8 SYMBOL SET (PRIMARY)
<ESC>(9U | ANSI SYMBOL SET (PRIMARY)
|
<ESC>(s#B | STROKE WEIGHT (PRIMARY)
<ESC>(s#H | FONT PITCH (PRIMARY)
<ESC>(s#T | TYPEFACE (PRIMARY)
<ESC>(s#V | POINT SIZE (PRIMARY)
<ESC>(s#W[descriptor and data] | DOWNLOAD CHARACTER
|
<ESC>(s0P | FIXED SPACING (PRIMARY)
<ESC>(s0S | UPRIGHT CHARACTER STYLE (PRIMARY)
<ESC>(s1P | PROPORTIONAL SPACING (PRIMARY)
<ESC>(s1S | ITALIC CHARACTER STYLE (PRIMARY)
|
<ESC>)#@ | SECONDARY FONT DEFAULT
<ESC>)#X | DESIGNATE DOWNLOADED FONT AS SECONDARY
|
<ESC>)0A | MATH SYMBOL SET (SECONDARY)
<ESC>)0B | LINE DRAW SYMBOL SET (SECONDARY)
<ESC>)0U | USASCII SYMBOL SET (SECONDARY)
<ESC>)8K | KANA-8 SYMBOL SET (SECONDARY)
<ESC>)8U | ROMAN-8 SYMBOL SET (SECONDARY)
<ESC>)9U | ANSI SYMBOL SET (SECONDARY)
|
<ESC>)s#B | STROKE WEIGHT (SECONDARY)
<ESC>)s#H | FONT PITCH (SECONDARY)
<ESC>)s#T | TYPEFACE (SECONDARY)
<ESC>)s#V | POINT SIZE (SECONDARY)
<ESC>)s#W[font descriptor] | CREATE FONT (FONT DESCRIPTOR)
|
<ESC>)s0P | FIXED SPACING (SECONDARY)
<ESC>)s0S | UPRIGHT CHARACTER STYLE (SECONDARY)
<ESC>)s1P | PROPORTIONAL SPACING (SECONDARY)
<ESC>)s1S | ITALIC CHARACTER STYLE (SECONDARY)
|
<ESC>*b#W[rater data] | TRANSFER RASTER GRAPHICS
|
<ESC>*c#A | HORIZONTAL RULE/PATTERN SIZE
<ESC>*c#B | VERTICAL RULE/PATTERN SIZE (DOTS)
<ESC>*c#D | SPECIFY FONT ID
<ESC>*c#E | SPECIFY CHARACTER CODE
<ESC>*c#F | FONT AND CHARACTER CONTROL
<ESC>*c#G | PATTERN ID
<ESC>*c#H | HORIZONTAL RULE/PATTERN SIZE (DECIPOINTS)
<ESC>*c#P | PRINT RULE/PATTERN
<ESC>*c#V | VERTICAL RULE/PATTERN SIZE (DECIPOINTS)
|
<ESC>*p#X | HORIZONTAL CURSOR MOVES (DOTS)
<ESC>*p#Y | VERTICAL CURSOR MOVES (DOTS)
|
<ESC>*r#A | START RASTER GRAPHICS
<ESC>*rB | END RASTER GRAPHICS
<ESC>*t#R | RASTER GRAPHICS RESOLUTION
|
<ESC>9 | CLEAR SIZE MARGINS
<ESC>Y | ENABLE DISPLAY FUNCTIONS MODE
<ESC>Z | DISABLE DISPLAY FUNCTIONS MODE


Whats your printer manufacturer and model?


Cheers Steve

05-05-2004 at 11:04 AM
View Profile Send Email to User Show All Posts | Quote Reply
lakki_lakki
Level: Guest

icon Re: Printing in different language in dos mode with VB

My Printer is Epson LX-300 dot matrix, i am really thankful to you guys..please keep on..

05-05-2004 at 03:44 PM
| Quote Reply
steve_w
Level: Moderator


Registered: 18-04-2003
Posts: 1156
icon Re: Printing in different language in dos mode with VB

Try this

http://support.epson.ru/products/manuals/000352/part3.pdf

I think what you're after is on page 22

The syntax will be something like chr(27) & "(t9" & "Your text"

You may have to play about with it, I don't have one of those printers to try it.


Cheers Steve

05-05-2004 at 04:04 PM
View Profile Send Email to User Show All Posts | Quote Reply
lakki_lakki
Level: Guest

icon Re: Printing in different language in dos mode with VB

Thanks, steve. Let me try this and let you know..the result.

regards
lakki

05-05-2004 at 04:06 PM
| Quote Reply
lakki_lakki
Level: Guest

icon Re: Printing in different language in dos mode with VB

Hi, Steve....it does prints on the screen but not on the print..same result..sorry mate..i am using this like that--->

'248 for ø and 216 for Ø

but how to use this function for both..please help me, i think soon i have done this...

Print #1,  chr(248) (t9) & "Leveringstype : Utkjøring"

Is that correct or



[Edited by lakki_lakki on 05-05-2004 at 05:50 PM GMT]

05-05-2004 at 05:41 PM
| Quote Reply
lakki_lakki
Level: Guest

icon Re: Printing in different language in dos mode with VB

Hi, Steve...it does not work, now please read this..when i try to use "edit" to check it then it does not appear those words in edit either..i don't what do. I have tried everything i could but same result..please to understand my problem do this or come on chatting tommarow...

" make a print.dat file first and output forinstance some text like "norwegian is a funny language..i can't print Ø or æ

and then print from that print.dat file while using batchfile with shell command or just try to open the print.bat file in "edit" dos..

regards
lakki

05-05-2004 at 08:13 PM
| Quote Reply
steve_w
Level: Moderator


Registered: 18-04-2003
Posts: 1156
icon Re: Printing in different language in dos mode with VB

Try this


Print #1,  chr(27) & "(t9" & "Leveringstype : Utkjøring"

The chr(27) is the escape character. I'm going to be a bit busy today but if I can I'll look a bit later.


Cheers Steve

06-05-2004 at 10:10 AM
View Profile Send Email to User Show All Posts | Quote Reply
lakki_lakki
Level: Guest

icon Re: Printing in different language in dos mode with VB

I tried that steve but the printer just stops when it comes to that....

Still no..

Regards
lakki

06-05-2004 at 12:25 PM
| Quote Reply
steve_w
Level: Moderator


Registered: 18-04-2003
Posts: 1156
icon Re: Printing in different language in dos mode with VB

Try this one

Print #1,  chr(27) & "R9" & "Leveringstype : Utkjøring


Steve  

07-05-2004 at 10:29 AM
View Profile Send Email to User Show All Posts | Quote Reply
lakki_lakki
Level: Guest

icon Re: Printing in different language in dos mode with VB

Printer takes a lots of time to react on that, same result..no norwegian words.  

lakki

07-05-2004 at 10:58 AM
| Quote Reply
steve_w
Level: Moderator


Registered: 18-04-2003
Posts: 1156
icon Re: Printing in different language in dos mode with VB

Okay, got me beat   sorry about that.

You could try this link for support from free epson.

http://www.epson.co.uk/support/email/index.htm

Have a good weekend

Steve  

07-05-2004 at 11:06 AM
View Profile Send Email to User Show All Posts | Quote Reply
lakki_lakki
Level: Guest

icon Re: Printing in different language in dos mode with VB

well,

i don't think that is the case here, it is something with the dos, which simply refuse to print norwegian words..now i have checked it, there is no problem in windows., if i give ascii value of 248 mean ø but when i open that file in Edit then i can't se that word, but i see something else..and ascii code 155 shows that word ø, now that's not correct.so there is something more...you just try to write those words in note pad and then try to open it in "Edit(dos)", then you'll know what i am talking about. So pls try again.

Regards
lakki

07-05-2004 at 12:08 PM
| Quote Reply
steve_w
Level: Moderator


Registered: 18-04-2003
Posts: 1156
icon Re: Printing in different language in dos mode with VB

Dos is only going to display what it thinks the ascii char is going to look like, that will depend on the code page you are using. The printer will also do the same. If its any help I have attached a dos application which displays the characters for each ascii value.


Steve  

____________________________
Attached:
asc.zip 2 KB (Downloads: 11)

07-05-2004 at 12:34 PM
View Profile Send Email to User Show All Posts | Quote Reply
lakki_lakki
Level: Guest

icon Re: Printing in different language in dos mode with VB

well, i have that list already. But let me try one thing more. Everything is being printed correctly if i open that dat.file in the note pad. And then print form the note pad. But that prints on full display, i mean On a A4 paper.

But i am using a different type of paper..well let's what happens..

regards
lakki

07-05-2004 at 01:07 PM
| Quote Reply
lakki_lakki
Level: Guest

icon Re: Printing in different language in dos mode with VB

Hi steve

I have still not mananged to print norwegian words..did you find any more information about that please help me..

Waiting for you reply

lakki

09-05-2004 at 06:28 PM
| Quote Reply
steve_w
Level: Moderator


Registered: 18-04-2003
Posts: 1156
icon Re: Printing in different language in dos mode with VB

Sorry, misunderstood you , I thought you said that you were going to try something. I'll look again tomorrow.


Steve

10-05-2004 at 03:53 PM
View Profile Send Email to User Show All Posts | Quote Reply
lakki_lakki
Level: Guest

icon Re: Printing in different language in dos mode with VB

Hi, Steve..

Thanks for paying tention to me. I think my problem is not with the print, it is more for vb code. Because is just doing his job. He is getting something and throwing it to the paper. It is dos which is not accepting norwegian chracters.

So if you just write some norwegian words..like

Løk(onions) is good for the health, and åpen(open)..save this file and open this is in dos..and then print from the dos(on the screen or to a printer)..then you know my problem...

I hope we manange this togehter...i am so depressed because of this.

lakki

10-05-2004 at 08:05 PM
| Quote Reply
lakki_lakki
Level: Guest

icon Re: Printing in different language in dos mode with VB

Hi,  I did it, thanks for your help, if you want to know how i did it, then you are welcome to ask me...

bye
lakki

12-05-2004 at 04:48 PM
| Quote Reply
steve_w
Level: Moderator


Registered: 18-04-2003
Posts: 1156
icon Re: Printing in different language in dos mode with VB

Well done, please post how you did for two reasons, a) I'd like to know if I was on the right track and b) for any future posts we get.


Thanks Steve  

13-05-2004 at 09:42 AM
View Profile Send Email to User Show All Posts | Quote Reply
lakki_lakki
Level: Guest

icon Re: Printing in different language in dos mode with VB

Hi,

I made a funtion as " string" using "replace"....to replace the words.. by using a public funtion...and then just finding out the chr(value) of each word, using "if and else"...through out..

like this..

if inStr("Text",chr(value) > 0 then

Variable = Replace("text", chr(value), char value)

end if

etc..

cheers
lakki

13-05-2004 at 03:44 PM
| Quote Reply
AndreaVB Forum : Printing : Printing in different language in dos mode with VB
Previous Topic (Data Report - Date Type field)Next Topic (Printing a receipt from list) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder