home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / text / frame / 2498 < prev    next >
Encoding:
Internet Message Format  |  1992-07-30  |  8.9 KB

  1. Path: sparky!uunet!gatech!purdue!yuma!csn!stortek!bushdoc!terryg
  2. From: terry_gottehrer@stortek.com (terry gottehrer)
  3. Newsgroups: comp.text.frame
  4. Subject: Frame to ASCII xlation summary
  5. Message-ID: <1992Jul30.190034.2129@stortek.com>
  6. Date: 30 Jul 92 19:00:34 GMT
  7. Sender: usenet@stortek.com
  8. Organization: StorageTek
  9. Lines: 371
  10.  
  11.  
  12. Following is a summary of responses to my question regarding translation of
  13. Frame files to ASCII.
  14.  
  15. (BTW: I had overwritten the ASCII file with Frame-format before vi-ing the
  16. ASCII file; one makes dumb mistakes like this when overworked.)
  17.  
  18. >This question is simple, but here it is. I want to convert a
  19. >Frame-format file to ASCII. I've tried "Save As", "Text Only" with
  20. >Carriage Return at "End of Each Line." It doesn't yield
  21. >an ASCII file; there is lots of control characters in the saved
  22. >file. I can't find information on this in the manuals. Can
  23. >anyone help? I'm running Frame on a Sun workstation.
  24.  
  25. Response 1:
  26.  
  27. I have a PC at home and occasionally log in to system at work to read my
  28. e-mail. I've encounter some Frame document that was mailed to me. So I
  29. use the accompanying command "fmbatch" to convert it to text file.
  30.  
  31. % fmbatch
  32. -> Open filename.doc
  33. -> SaveAs a filename.doc filename.txt
  34. -> Quit
  35. % vi filename.txt
  36.  
  37. This has always worked. I hope it works for you. BTW, I'm using FrameMaker
  38. 3.1 on Motorola 8000 RISC computer.
  39.  
  40. Response 2:
  41.  
  42. After You have saved You should use the transfer program txttois1
  43.  
  44.     
  45.     txttois1 in_file out_file
  46.  
  47. If You want to use ISO-Latin characters rather than 7-bit ASCII text You 
  48. have to uncomment the following line in the file 
  49. $FMHOME/.fminit2.0.ps/xresources/Maker 
  50.  
  51.     Maker.textCharacterEncoding:    ISOLatin1
  52.  
  53.  
  54. This works for FrameMaker 3.0 under SunOS 4.1.2
  55.  
  56.  
  57. Response 3:
  58.  
  59. The control characters may be due to special symbols in the text,
  60. such as the (TM) or (c) symbols.  Also, weired text characters can
  61. be the the translation of characters in a symbol font.  For example,
  62. ^[qthe bullet that I use for bulleted lists is the 'l' character in
  63. the Zapf Dingbats font, so it appears as 'l' when I Save As Text.
  64.  
  65. I don't know any way to easily eliminate them, unless you write an
  66. editing script.
  67.  
  68. Response 4:
  69.  
  70. If you've got unexpected ASCII control characters (ie ASCII code < 32)
  71. you've got problems.
  72.  
  73. If you've got unexpected top-bit-set characters (ie ASCII code > 127) then
  74. there's a probable explanation. In the file .fminit2.0/preferences (FM 3.0
  75. for SunView - pathname may differ on other platforms) there is a variable
  76. 'TextCharacterEncoding'. This needs to be set to ASCII for the software to
  77. work how you want; it may be set to ISOLatin1 or similar on your system.
  78. The comments in the file explain how to change it.
  79.  
  80. Don't forget to look in all the various locations Framemaker looks for this
  81. file: ~, <startdir> and $FMHOME.
  82.  
  83. Response 5:
  84.  
  85. Hmmm . . . both saves work fine on my NeXT - giving me "vi"-able  
  86. files with standard ASCII. Do you have graphics included in your text  
  87. flows? That might make a difference - I haven't tried.
  88.  
  89. Another way to grab the text is just do a "Select All" in the text  
  90. flow, copy, then move into a text-editor and paste. That works on a  
  91. NeXT, anyway.
  92.  
  93. Response 6:
  94.  
  95. I'm sure the Frame gurus have a solution, but here is how
  96. I translated Framemaker to ascii:
  97.  
  98.  
  99. Print the document to a file in Postscript format and use the
  100. utility ps2ascii to convert the ps form to ascii. 
  101.  
  102. I have attached ps2ascii here. I do not believe it is commercial 
  103. or copyrighted (one can use it if the credits are intact?). This works
  104. on Sun systems (4.1.1 or later) with psh somewhere on the system.
  105.  
  106. Let me know if you get any other solutions.
  107.  
  108. Joel Oguete
  109. Ericsson Network Systems
  110. Richardson, TX 
  111.  
  112.  
  113. ------------------ cut here -------------------
  114. #!/bin/csh -f
  115. # Converts PostScript to ASCII on a Sun by sending the PS into
  116. # psh.  The ASCII is spat back out on stdout.
  117. # Written by: Len Hamey, Macquarie University, NSW 2109 AUSTRALIA,
  118. #  len@mpce.mq.edu.au, May-June 1992.
  119. # This version uses psh; one could also use pageview and/or
  120. # ghostscript.
  121. cat - $* <<'EOF' | psh
  122. %!PS-Adobe-2.0
  123. %%EndComments
  124. /psa-lastx 30000 def
  125. /psa-lasty -30000 def
  126. /psa-beginx 0 def
  127. /psa-gap 0 def
  128. /psa-newline (\n) def
  129. /psa-space ( ) def
  130. /psa-line 512 string def
  131. /psa-linep 0 def
  132. /psa-recurrent 0 def
  133. /psa-tex-specials
  134. (?) % 00 = Gamma
  135. (?) % 01 = Delta
  136. (?) % 02 = Theta
  137. (?) % 03 = Lambda
  138. (?) % 04 = Xi
  139. (?) % 05 = Pi
  140. (?) % 06 = Sigma
  141. (?) % 07 = 
  142. (?) % 10 = Phi
  143. (?) % 11 = Psi
  144. (?) % 12 = Omega
  145. (ff) % 13
  146. (fi) % 14
  147. (fl) % 15
  148. (ffi) % 16
  149. (ffl) % 17
  150. (i) % 20 = i without dot
  151. (j) % 21 = j without dot
  152. (`) % 22
  153. (') % 23
  154. (?) % 24 = caron
  155. (?) % 25 = breve
  156. (-) % 26 = macron
  157. (?) % 27 = ring
  158. (,) % 30 = cedilla
  159. (B) % 31 = beta
  160. (ae) % 32
  161. (oe) % 33
  162. (o/) % 34 = o with slash through it
  163. (AE) % 35
  164. (OE) % 36
  165. (O/) % 37
  166. ] def
  167. /psa-ps-specials
  168. [
  169. (?) % 200
  170. (?) % 201
  171. (?) % 202
  172. (?) % 203
  173. (?) % 204
  174. (?) % 205
  175. (?) % 206
  176. (?) % 207
  177. (?) % 210
  178. (?) % 211
  179. (?) % 212
  180. (?) % 213
  181. (?) % 214
  182. (?) % 215
  183. (?) % 216
  184. (?) % 217
  185. (?) % 220
  186. (?) % 221
  187. (?) % 222
  188. (?) % 223
  189. (?) % 224
  190. (?) % 225
  191. (?) % 226
  192. (?) % 227
  193. (?) % 230
  194. (?) % 231
  195. (?) % 232
  196. (?) % 233
  197. (?) % 234
  198. (?) % 235
  199. (?) % 236
  200. (?) % 237
  201. (?) % 240
  202. (!) % 241 = upside-down !
  203. (c) % 242 = cent
  204. (Pd) % 243 = Pound sterling
  205. (/) % 244 = fraction
  206. (Yen) % 245 = Y overlayed with =
  207. (f) % 246 = florin
  208. (Section) % 247
  209. (?) % 250 = currency
  210. (') % 251 = single (vertical) quote
  211. (``) % 252 = double quote (left)
  212. (<<) % 253
  213. (<) % 254
  214. (>) % 255
  215. (fi) % 256
  216. (fl) % 257
  217. (?) % 260
  218. (--) % 261 = endash
  219. (+) % 262 = dagger
  220. (++) % 263 = double dagger
  221. (.) % 264 = centred period
  222. (?) % 265
  223. (d) % 266 = (symbol font) partial diff [Paragraph in text font]
  224. (*) % 267 = Bullet
  225. (,) % 270
  226. (,,) % 271
  227. ('') % 272
  228. (>>) % 273
  229. (...) % 274 = ellipsis
  230. (%o) % 275 = perthousand
  231. (?) % 276
  232. (?) % 277 = question upside down
  233. (?) % 300
  234. (`) % 301 = grave
  235. (') % 302 = acute
  236. (^) % 303 = circumflex
  237. (~) % 304 = tilde
  238. (-) % 305 = macron
  239. (?) % 306 = breve
  240. (.) % 307 = dotaccent
  241. (..) % 310 = dieresis
  242. (?) % 311
  243. (o) % 312 = ring
  244. (,) % 313 = cedilla
  245. (?) % 314
  246. (") % 315 = hungarumlaut
  247. (,) % 316 = ogonek
  248. (?) % 317 = caron
  249. (---) % 320 = emdash
  250. (?) % 321
  251. ((R)) % 322 (symbol font)
  252. ((c)) % 323 (symbol font)
  253. (TM) % 324 (symbol font)
  254. (?) % 325
  255. (?) % 326
  256. (?) % 327
  257. (?) % 330
  258. (?) % 331
  259. (?) % 332
  260. (?) % 333
  261. (?) % 334
  262. (?) % 335
  263. (?) % 336
  264. (?) % 337
  265. (?) % 340
  266. (AE) % 341
  267. ((R)) % 342 (symbol font)
  268. ((c)) % 343 (symbol font) [ordfeminine in text font]
  269. (TM) % 344
  270. (?) % 345
  271. (?) % 346
  272. (?) % 347
  273. (L) % 350
  274. (O/) % 351
  275. (OE) % 352
  276. (o) % 353
  277. (?) % 354
  278. (?) % 355
  279. (?) % 356
  280. (?) % 357
  281. (?) % 360
  282. (ae) % 361
  283. (?) % 362
  284. (?) % 363
  285. (?) % 364
  286. (i) % 365 = dotlessi
  287. (?) % 366
  288. (?) % 367
  289. (l) % 370
  290. (o/) % 371
  291. (oe) % 372
  292. (B) % 373
  293. (?) % 374
  294. (?) % 375
  295. (?) % 376
  296. (?) % 377
  297. ] def
  298. % psa-cdef: Concatenate new1, current and new2 definitions of an operator.
  299. % <key> <new1> <new2> cdef
  300. /psa-cdef { %def
  301.   /psa-currentdef 3 index load def
  302.   /psa-cdef-end exch def
  303.   [ exch aload pop
  304.     /psa-currentdef load dup type
  305.     /operatortype ne {aload pop} if
  306.     /psa-cdef-end load aload pop
  307.   ] cvx
  308.   def
  309. } def
  310. /psa-printstring
  311. { % string
  312.   psa-line psa-linep 2 index putinterval % string
  313.   length psa-linep add /psa-linep exch store % -
  314. } def
  315. /psa-printchar
  316. { % character
  317.   psa-line psa-linep 2 index put % character
  318.   pop /psa-linep psa-linep 1 add store % -
  319. } def
  320. /psa-begin
  321. {
  322.   % show-args string nargs
  323.   exch dup currentpoint % args nargs string string currx curry
  324.   5 -1 roll % args string string currx curry nargs
  325.   3 add % args string string currx curry nargs+3
  326.   3 roll % string currx curry args string
  327. } bind def
  328. /psa-end
  329. {
  330.   % string beginx beginy
  331.   % Check for change in Y co-ordinate: interpreted as new-line.
  332.   psa-lasty ne
  333.   { psa-newline psa-printstring } if
  334.   % Check for significant gap between characters: interpreted as space.
  335.   % Compute gap relative to previous piece of text
  336.   dup psa-lastx sub
  337.   % Compute width of current text string as a measure of typical
  338.   % character widths.
  339.   % stack: string beginx deltax
  340.   currentpoint pop 2 index sub % stack: string beginx deltax currx-beginx
  341.   3 index length div 6 div % stack: string beginx deltax currx-beginx/length/6
  342.   gt
  343.   { psa-space psa-printstring } if % stack: string beginx
  344.   pop
  345.   % Process all characters, translating TeX ligatures.
  346.   % (For non-Tex, use the PS print operator instead of the forall loop)
  347.   { dup 31 le
  348.     { psa-tex-specials exch get psa-printstring }
  349.     {
  350.       dup 128 ge
  351.       { psa-ps-specials exch 128 sub get psa-printstring }
  352.       { psa-printchar } ifelse
  353.     } ifelse
  354.   } forall
  355.   % Output the buffered text
  356.   psa-line 0 psa-linep getinterval print 
  357.   /psa-linep 0 store 
  358.   currentpoint /psa-lasty exch store /psa-lastx exch store
  359. } bind def
  360.  
  361. /show { 1 psa-begin } { psa-end } psa-cdef
  362. /kshow { 2 psa-begin } { psa-end } psa-cdef
  363. /widthshow { 4 psa-begin } { psa-end } psa-cdef
  364. /ashow { 3 psa-begin } { psa-end } psa-cdef
  365. /awidthshow { 6 psa-begin } { psa-end } psa-cdef
  366. 'EOF'
  367. exit
  368.  
  369. ------------------------ cut here ------------------
  370.  
  371. Thanks for all the response.
  372.  
  373.  
  374. Terry
  375.  
  376. --
  377. Terry
  378. Louisville, CO (by Boulder,Longmont,Denver)
  379. (303)673-4943
  380. Terry_Gottehrer@stortek.com
  381.