How to convert DOS-TXT file OEM-866 (Rus) in doc?

This forum is for eXpress++ general support.
Post Reply
Message
Author
User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

How to convert DOS-TXT file OEM-866 (Rus) in doc?

#1 Post by Eugene Lutsenko »

How to convert DOS-TXT file OEM-866 (Rus) to doc in Alaska?
Attachments
134-001 Луценко Е.В.zip
(1.82 KiB) Downloaded 717 times

User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

Re: How to convert DOS-TXT file OEM-866 (Rus) in doc?

#2 Post by Eugene Lutsenko »

How to convert DOS-TXT file OEM-866 (Rus) to doc-file or pdf-file in Alaska?

Victorio
Posts: 620
Joined: Sun Jan 18, 2015 11:43 am
Location: Slovakia

Re: How to convert DOS-TXT file OEM-866 (Rus) in doc?

#3 Post by Victorio »

Hi Eugene

I am also converting TXT files in CP 852 Latin2 (DOS) to PDF,

First I convert file from ANSI to OEM coding:

FUNCTION KONV_ANSI2OEM // konverzia súboru z ANSI do OEM
LOCAL outriadok:=""
LOCAL nSource18,nTarget18
PARAMETERS infile,outfile
IF ( nSource18 := FOpen( infile, FO_READ ) ) == -1
DC_Impl(cCakaj)
oznam2("Vstupný súbor sa nedá otvoriť:",infile)
return(.F.)
ENDIF
velkostsuboru:=filesize(infile)
cSourceString := Space( velkostsuboru )
nBytes := velkostsuboru
zostatok:=velkostsuboru
nSourcestring := FRead( nSource18, @cSourceString, velkostsuboru )
FClose( nSource18 )
IF ( nTarget18 := FCreate( outfile, FC_NORMAL ) ) == -1
DC_Impl(cCakaj)
oznam2("Výstupný súbor sa nedá otvoriť:",outfile)
return(.F.)
ENDIF
outriadok:=convtooemcp(cSourcestring) // samotná konverzia
FWrite( nTarget18,outriadok)
FClose( nTarget18 )
RETURN(0)

You can examine also convtoansicp() function, but for me works right convtooemcp

Then I write to PDF with PDF Creator

* set options for generate PDF report
DCPRINT OPTIONS TO aOptions NAME 'RauknReport' ;
BUSYMESSAGE "Generujem tlačovú zostavu" ;
FORMSIZE XBPPRN_FORM_A4 ;
VIEWPORT 150,150,4750,6500 ; // toto je zhruba ok
MARGIN {-2,1} // prvé číslo horný okraj, druhé ľavý

* print file to PDF.
dcpstatus:=DC_PRINTFILE(suborptk2,.F.,"11.Courier New",aOptions)

where suborptk2 is converted file

RauknReport is "virtual" printer profile in PDF Creator.

This works fine, but You must have PDF Creator installed and also profile.

On Windows 10 can use Microsoft Print to PDF like this

DCPRINT ON NAME "Microsoft Print to PDF" TOFILE OUTFILE (cestatlac+'InfokatReport.Pdf') ;
TO oPrinter

Or can use Bullzip or PSCRIPT.DLL library, with DCPS, this is best solution.

User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

Re: How to convert DOS-TXT file OEM-866 (Rus) in doc?

#4 Post by Eugene Lutsenko »

Thank You Victorio!
Be sure to try and hopefully succeed

User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

Re: How to convert DOS-TXT file OEM-866 (Rus) in doc?

#5 Post by Eugene Lutsenko »

Victorio!

And could you help me and make running the example program. This program when run, downloads a txt-file and converts it to a pdf-file. Examples of source and result files is in the first message. To be honest, I fiddled a bit, I read, I realized that there is still a lot of things plays role. In the end I have failed, what we need. Converts the file, but instead of pseudographics characters get just a dash, equal sign, etc.

Victorio
Posts: 620
Joined: Sun Jan 18, 2015 11:43 am
Location: Slovakia

Re: How to convert DOS-TXT file OEM-866 (Rus) in doc?

#6 Post by Victorio »

Hi,
If you still have not solution, I can look for this.
I had also problem with convert semigraphics characters to PDF, especially when have two version of TXT files one in CP852 DOS page and other in Win1250 and need join it to one file and convert to PDF.

I must try your file what result have I. When I open your file in notepad, I do not see correct text because I have not Cyrilic on my PC installed.

User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

Re: How to convert DOS-TXT file OEM-866 (Rus) in doc?

#7 Post by Eugene Lutsenko »

I use AkelPad-4.9.8-bin-rus:
https://yadi.sk/d/ORdeuYWx3JCZgk

While I use it to convert txt to pdf. It is working correctly. Manually convert each file in turn (typing).


User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

Re: How to convert DOS-TXT file OEM-866 (Rus) in doc?

#9 Post by Eugene Lutsenko »

Victorio!

And do not tell how to create a profile PDFCreater "RauknReport"

Post Reply