Section 2 : Client Applications

Q207: How do I send WordPerfect files from a DOS machine?


? Got something to say about this answer? Hit the question mark to invoke the mailer and send your comments to the HylaFAQ maintainers.

Q.
How do I send WordPerfect files from a DOS machine?

I have a user who uploads Wordperfect text-output files from his PC to our network, and then attempts to fax the files. The files have a trailing ^Z (DOS EOF marker?), so sendfax doesn't recognize the files as ascii and aborts.

We can clean up the files manually using a dos2unix filter, but what can I use as a typerule to automate this? The EOF marker is not at any fixed offset, and the file won't match ascii only because of the EOF marker. Has anyone already done this for me?

A.
Date: Wed, 16 Mar 94 15:17:31 MST
From: morrow@cns.ucalgary.ca (Bill Morrow)
Subject: SUMMARY: faxing Wordperfect files directly

last week I asked about how to get sendfax to handle Wordperfect format files directly, so that users would not have to convert their WP files to text or Postcript by hand. The following is what I came up with.

I've attached the "source" below, it's fairly simple and short.

Note that this requires Unix Wordperfect, we have version 5.0.

Thanks to les@fb.com (Les Mikesell) for hints, and the wptops script.

First add this rule to your typerules:

---------------------- cut here ---------------------------------- 0 byte 0xff error WordPerfect document >1 string WPC ps /usr/local/bin/wpr %i >%o ---------------------- cut here ---------------------------------- the wpr script converts WP format to Postscript by running Wordperfect's wprint, which WP cleverly did not make a filter. ---------------------- cut here ---------------------------------- #!/bin/sh # wpr - output Postscript from a WP file infile=/tmp/WP2PSin$$; outfile=/tmp/WP2PSout$$; cat $1 > $infile /usr/local/wp/sun4/bin/wprint -i$outfile $infile > /dev/null 2>&1 # wait for wprint to finish while [ ! -f $outfile ]; do sleep 1 done /usr/local/etc/wptops < $outfile /bin/rm -f $infile $outfile ---------------------- cut here ---------------------------------- wptops is Les Miksell's perl script which cleans up Word Perfect's corrupt Postscript files. ---------------------- cut here ---------------------------------- #!/usr/local/bin/perl # Original version came from Angus Duggans's psutils # modified version from les@fb.com (Les Mikesell ) # fixwpps: get semi-conforming PostScript out of WordPerfect 5.[01] file # feed this into perl #eval 'exec perl -S $0 "$@"' # if $running_under_some_shell; $page = 0; while (<>) { s/^ *%!/%!/; s/\015//; s/\004//; # s/(_[a-zA-Z]+)([0-9]+)/\1 \2/g; if (/^_bp/) { $page++; print STDOUT "%%Page: $page $page\n"; print STDOUT $_; } elsif (/^([^\/].*\S.*)(_bp.*)/) { $page++; print STDOUT "$1\n"; print STDOUT "%%Page: $page $page\n"; print STDOUT "$2\n"; } elsif (/^_ed/) { print STDOUT "%%Trailer:\n"; print STDOUT $_; print STDOUT "%%Pages: $page\n"; } elsif (/^([^\/].*\S.*)(_ed.*)/) { print STDOUT "$1\n"; print STDOUT "%%Trailer:\n"; print STDOUT "$2\n"; print STDOUT "%%Pages: $page\n"; } else { print STDOUT $_; } } ---------------------- cut here ----------------------------------


 Back to FAQ Index FAQ Index  Next question in List Q208: Document file is not valid TIFF?
faq@hylafax.org. Last updated $Date: 1999/12/29 23:24:04 $.