Printing from older DOS programs...

You can share your experience with HMG. Share with some screenshots/project details so that others will also be benefited.

Moderator: Rathinagiri

User avatar
mol
Posts: 2993
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Has thanked: 162 times
Been thanked: 87 times
Contact:

Printing from older DOS programs...

Post by mol » Fri Jan 09, 2009 9:46 am

I have a few big projects written for DOS and printers connected via LPT.
Now it's big problem - most of printers are connected via USB (I used network mapping for LPT - and it worked), but what to do with printers, which don't have built in PCL language?

I wrote a program, which translates file with printer steering commands for document printable on every windows printer.
In my dos programs I can define printer commands, which turn on/off bold, italic, 10cpi, 12cpi, 17cpi, 20cpi.
For simplicity:
ESC "2" turn on bold
ESC "3" turn off bold
ESC "4" turn on italic
ESC "5" turn off italic
ESC "6" turn on 5cpi
ESC "7" turn on 10cpi
ESC "8" turn on 12cpi
ESC "9" turn on 17cpi
ESC "A" turn on 20cpi

Now, I can print my document/report to file and then run my MOLDruk.Exe to print it on default window printer.
Program translates also native polish characters from CP852 to windows characters...
Program prints also convert graphical characters of frames to lines.
Document printed in this way on windows printer looks familiar to document printed on old dos compatible laser printer.

Maybe it will be useful for somebody.

PS. I don't have a time to translate all comments and variable names to English, but I think that program is written so clear.
I will try to help if somebody finds my program useful.

for example, I put pattern.prn - try do print it using:

MOLDruk pattern.prn



HAPPY TESTING!!!
Attachments
moldruk.zip
(3.6 KiB) Downloaded 587 times

User avatar
esgici
Posts: 4439
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Has thanked: 324 times
Been thanked: 99 times
Contact:

Post by esgici » Fri Jan 09, 2009 11:43 am

mol wrote: ...
Maybe it will be useful for somebody.

...
I will try to help if somebody finds my program useful.
...
Hi Marek

Thanks for sharing :)
PS. I don't have a time to translate all comments and variable names to English.
This is the bad news :(

Regards

--

esgici
Viva INTERNATIONAL HMG :D

User avatar
Rathinagiri
Posts: 5210
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Has thanked: 155 times
Been thanked: 144 times
Contact:

Post by Rathinagiri » Fri Jan 09, 2009 2:20 pm

Thanks a lot. :)
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.

User avatar
mol
Posts: 2993
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Has thanked: 162 times
Been thanked: 87 times
Contact:

Post by mol » Fri Jan 09, 2009 7:40 pm

esgici wrote:
mol wrote: ...
Maybe it will be useful for somebody.

...
I will try to help if somebody finds my program useful.
...
Hi Marek

Thanks for sharing :)
PS. I don't have a time to translate all comments and variable names to English.
This is the bad news :(

Regards

--

esgici

First weeeks of year are full of stupid work for me.
If I have few time, I'll translate everything to English.

User avatar
mol
Posts: 2993
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Has thanked: 162 times
Been thanked: 87 times
Contact:

Post by mol » Tue Jan 13, 2009 6:30 am

I think my first post was chaotic. So I will write how to print from your clipper program:
cBoldOnCommand := chr(27) +"2"
cBoldOffCommand := chr(27)+"3"
eol := chr(13) + chr(10)

set printer to "FileTopPrint.prn"
set device to print
@ prow(),pcol() say cBoldOnCommand + "This is bold text" + cBoldOffCommand +eol
eject
set device to screen
set printer to

run MolDruk.exe FileToPrint.prn

jparada
Posts: 233
Joined: Fri Jan 23, 2009 5:18 pm

Post by jparada » Wed Apr 15, 2009 4:15 am

Translated by Google,

I've taken a look at this post, because I have an old clipper program in operation, the issue is whether this program may work properly even in GDI printers / Windows only, because Unfortunately the client has this kind of printers that also have a USB port, so the question is whether it may work.

Thanks

Greetings
Javier

Spanish,

Le he echado un vistazo a este post, ya que tengo un viejo programa en clipper funcionando, el problema es si este programa podrá funcionar adecuadamente aún en impresoras GDI/solo windows, ya que por desfortuna el cliente cuenta con este tipo de impresoras, además de que tienen puerto USB, por ello la pregunta es, si es posible que funcione.

Gracias

Saludos
Javier

User avatar
Rathinagiri
Posts: 5210
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Has thanked: 155 times
Been thanked: 144 times
Contact:

Post by Rathinagiri » Wed Apr 15, 2009 4:22 am

Fantastic one. :)

Thanks a lot Javier.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.

User avatar
mol
Posts: 2993
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Has thanked: 162 times
Been thanked: 87 times
Contact:

Post by mol » Wed Apr 15, 2009 6:17 am

Of course, it works! I can post modified version of MOLDRUK>
One of my clients use this program to print to pdf orders from sale system (via PDFCreator... (I've changed... Marek).
If you are interesting, I will explain you how to use it.

Marek
Last edited by mol on Wed Apr 15, 2009 8:03 am, edited 1 time in total.

User avatar
Rathinagiri
Posts: 5210
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Has thanked: 155 times
Been thanked: 144 times
Contact:

Post by Rathinagiri » Wed Apr 15, 2009 6:47 am

Definitely Marek. Please do that. It would be useful for my gridprint project too.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.

User avatar
mol
Posts: 2993
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Has thanked: 162 times
Been thanked: 87 times
Contact:

Post by mol » Wed Apr 15, 2009 8:10 am

In this version you can set printer on which you want to print in moldruk.ini file
some thesaurus:

drukarka=printer - in this line you need to write full window's printer name
MaxDlStrony - Max Length of Page - max printeable length of page in millimetres
TytulDokumentu - Title of Document - print job name which appears in printer's window while printing
cpi - character per inch
cpi5 - wide (40 characters in line)
cpi10 normal,
etc.
Attachments
moldruk_source.zip
(12.96 KiB) Downloaded 446 times

Post Reply