From: terry_gottehrer@stortek.com (terry gottehrer)
Newsgroups: comp.text.frame
Subject: Frame to ASCII xlation summary
Date: 30 Jul 92 19:00:34 GMT
Organization: StorageTek


Following is a summary of responses to my question regarding translation of
Frame files to ASCII.

(BTW: I had overwritten the ASCII file with Frame-format before vi-ing the
ASCII file; one makes dumb mistakes like this when overworked.)

>This question is simple, but here it is. I want to convert a
>Frame-format file to ASCII. I've tried "Save As", "Text Only" with
>Carriage Return at "End of Each Line." It doesn't yield
>an ASCII file; there is lots of control characters in the saved
>file. I can't find information on this in the manuals. Can
>anyone help? I'm running Frame on a Sun workstation.

Response 1:

I have a PC at home and occasionally log in to system at work to read my
e-mail. I've encounter some Frame document that was mailed to me. So I
use the accompanying command "fmbatch" to convert it to text file.

% fmbatch
-> Open filename.doc
-> SaveAs a filename.doc filename.txt
-> Quit
% vi filename.txt

This has always worked. I hope it works for you. BTW, I'm using FrameMaker
3.1 on Motorola 8000 RISC computer.

Response 2:

After You have saved You should use the transfer program txttois1

	
	txttois1 in_file out_file

If You want to use ISO-Latin characters rather than 7-bit ASCII text You 
have to uncomment the following line in the file 
$FMHOME/.fminit2.0.ps/xresources/Maker 

	Maker.textCharacterEncoding:	ISOLatin1


This works for FrameMaker 3.0 under SunOS 4.1.2


Response 3:

The control characters may be due to special symbols in the text,
such as the (TM) or (c) symbols.  Also, weired text characters can
be the the translation of characters in a symbol font.  For example,
^[qthe bullet that I use for bulleted lists is the 'l' character in
the Zapf Dingbats font, so it appears as 'l' when I Save As Text.

I don't know any way to easily eliminate them, unless you write an
editing script.

Response 4:

If you've got unexpected ASCII control characters (ie ASCII code < 32)
you've got problems.

If you've got unexpected top-bit-set characters (ie ASCII code > 127) then
there's a probable explanation. In the file .fminit2.0/preferences (FM 3.0
for SunView - pathname may differ on other platforms) there is a variable
'TextCharacterEncoding'. This needs to be set to ASCII for the software to
work how you want; it may be set to ISOLatin1 or similar on your system.
The comments in the file explain how to change it.

Don't forget to look in all the various locations Framemaker looks for this
file: ~, <startdir> and $FMHOME.

Response 5:

Hmmm . . . both saves work fine on my NeXT - giving me "vi"-able  
files with standard ASCII. Do you have graphics included in your text  
flows? That might make a difference - I haven't tried.

Another way to grab the text is just do a "Select All" in the text  
flow, copy, then move into a text-editor and paste. That works on a  
NeXT, anyway.

Response 6:

I'm sure the Frame gurus have a solution, but here is how
I translated Framemaker to ascii:


Print the document to a file in Postscript format and use the
utility ps2ascii to convert the ps form to ascii. 

I have attached ps2ascii here. I do not believe it is commercial 
or copyrighted (one can use it if the credits are intact?). This works
on Sun systems (4.1.1 or later) with psh somewhere on the system.

Let me know if you get any other solutions.

Joel Oguete
Ericsson Network Systems
Richardson, TX 


------------------ cut here -------------------
#!/bin/csh -f
# Converts PostScript to ASCII on a Sun by sending the PS into
# psh.  The ASCII is spat back out on stdout.
# Written by: Len Hamey, Macquarie University, NSW 2109 AUSTRALIA,
#  len@mpce.mq.edu.au, May-June 1992.
# This version uses psh; one could also use pageview and/or
# ghostscript.
cat - $* <<'EOF' | psh
%!PS-Adobe-2.0
%%EndComments
/psa-lastx 30000 def
/psa-lasty -30000 def
/psa-beginx 0 def
/psa-gap 0 def
/psa-newline (\n) def
/psa-space ( ) def
/psa-line 512 string def
/psa-linep 0 def
/psa-recurrent 0 def
/psa-tex-specials
[ 
(?) % 00 = Gamma
(?) % 01 = Delta
(?) % 02 = Theta
(?) % 03 = Lambda
(?) % 04 = Xi
(?) % 05 = Pi
(?) % 06 = Sigma
(?) % 07 = 
(?) % 10 = Phi
(?) % 11 = Psi
(?) % 12 = Omega
(ff) % 13
(fi) % 14
(fl) % 15
(ffi) % 16
(ffl) % 17
(i) % 20 = i without dot
(j) % 21 = j without dot
(`) % 22
(') % 23
(?) % 24 = caron
(?) % 25 = breve
(-) % 26 = macron
(?) % 27 = ring
(,) % 30 = cedilla
(B) % 31 = beta
(ae) % 32
(oe) % 33
(o/) % 34 = o with slash through it
(AE) % 35
(OE) % 36
(O/) % 37
] def
/psa-ps-specials
[
(?) % 200
(?) % 201
(?) % 202
(?) % 203
(?) % 204
(?) % 205
(?) % 206
(?) % 207
(?) % 210
(?) % 211
(?) % 212
(?) % 213
(?) % 214
(?) % 215
(?) % 216
(?) % 217
(?) % 220
(?) % 221
(?) % 222
(?) % 223
(?) % 224
(?) % 225
(?) % 226
(?) % 227
(?) % 230
(?) % 231
(?) % 232
(?) % 233
(?) % 234
(?) % 235
(?) % 236
(?) % 237
(?) % 240
(!) % 241 = upside-down !
(c) % 242 = cent
(Pd) % 243 = Pound sterling
(/) % 244 = fraction
(Yen) % 245 = Y overlayed with =
(f) % 246 = florin
(Section) % 247
(?) % 250 = currency
(') % 251 = single (vertical) quote
(``) % 252 = double quote (left)
(<<) % 253
(<) % 254
(>) % 255
(fi) % 256
(fl) % 257
(?) % 260
(--) % 261 = endash
(+) % 262 = dagger
(++) % 263 = double dagger
(.) % 264 = centred period
(?) % 265
(d) % 266 = (symbol font) partial diff [Paragraph in text font]
(*) % 267 = Bullet
(,) % 270
(,,) % 271
('') % 272
(>>) % 273
(...) % 274 = ellipsis
(%o) % 275 = perthousand
(?) % 276
(?) % 277 = question upside down
(?) % 300
(`) % 301 = grave
(') % 302 = acute
(^) % 303 = circumflex
(~) % 304 = tilde
(-) % 305 = macron
(?) % 306 = breve
(.) % 307 = dotaccent
(..) % 310 = dieresis
(?) % 311
(o) % 312 = ring
(,) % 313 = cedilla
(?) % 314
(") % 315 = hungarumlaut
(,) % 316 = ogonek
(?) % 317 = caron
(---) % 320 = emdash
(?) % 321
((R)) % 322 (symbol font)
((c)) % 323 (symbol font)
(TM) % 324 (symbol font)
(?) % 325
(?) % 326
(?) % 327
(?) % 330
(?) % 331
(?) % 332
(?) % 333
(?) % 334
(?) % 335
(?) % 336
(?) % 337
(?) % 340
(AE) % 341
((R)) % 342 (symbol font)
((c)) % 343 (symbol font) [ordfeminine in text font]
(TM) % 344
(?) % 345
(?) % 346
(?) % 347
(L) % 350
(O/) % 351
(OE) % 352
(o) % 353
(?) % 354
(?) % 355
(?) % 356
(?) % 357
(?) % 360
(ae) % 361
(?) % 362
(?) % 363
(?) % 364
(i) % 365 = dotlessi
(?) % 366
(?) % 367
(l) % 370
(o/) % 371
(oe) % 372
(B) % 373
(?) % 374
(?) % 375
(?) % 376
(?) % 377
] def
% psa-cdef: Concatenate new1, current and new2 definitions of an operator.
% <key> <new1> <new2> cdef
/psa-cdef { %def
  /psa-currentdef 3 index load def
  /psa-cdef-end exch def
  [ exch aload pop
    /psa-currentdef load dup type
    /operatortype ne {aload pop} if
    /psa-cdef-end load aload pop
  ] cvx
  def
} def
/psa-printstring
{ % string
  psa-line psa-linep 2 index putinterval % string
  length psa-linep add /psa-linep exch store % -
} def
/psa-printchar
{ % character
  psa-line psa-linep 2 index put % character
  pop /psa-linep psa-linep 1 add store % -
} def
/psa-begin
{
  % show-args string nargs
  exch dup currentpoint % args nargs string string currx curry
  5 -1 roll % args string string currx curry nargs
  3 add % args string string currx curry nargs+3
  3 roll % string currx curry args string
} bind def
/psa-end
{
  % string beginx beginy
  % Check for change in Y co-ordinate: interpreted as new-line.
  psa-lasty ne
  { psa-newline psa-printstring } if
  % Check for significant gap between characters: interpreted as space.
  % Compute gap relative to previous piece of text
  dup psa-lastx sub
  % Compute width of current text string as a measure of typical
  % character widths.
  % stack: string beginx deltax
  currentpoint pop 2 index sub % stack: string beginx deltax currx-beginx
  3 index length div 6 div % stack: string beginx deltax currx-beginx/length/6
  gt
  { psa-space psa-printstring } if % stack: string beginx
  pop
  % Process all characters, translating TeX ligatures.
  % (For non-Tex, use the PS print operator instead of the forall loop)
  { dup 31 le
    { psa-tex-specials exch get psa-printstring }
    {
      dup 128 ge
      { psa-ps-specials exch 128 sub get psa-printstring }
      { psa-printchar } ifelse
    } ifelse
  } forall
  % Output the buffered text
  psa-line 0 psa-linep getinterval print 
  /psa-linep 0 store 
  currentpoint /psa-lasty exch store /psa-lastx exch store
} bind def

/show { 1 psa-begin } { psa-end } psa-cdef
/kshow { 2 psa-begin } { psa-end } psa-cdef
/widthshow { 4 psa-begin } { psa-end } psa-cdef
/ashow { 3 psa-begin } { psa-end } psa-cdef
/awidthshow { 6 psa-begin } { psa-end } psa-cdef
'EOF'
exit

------------------------ cut here ------------------

Thanks for all the response.


Terry

--
Terry
Louisville, CO (by Boulder,Longmont,Denver)
(303)673-4943
Terry_Gottehrer@stortek.com