Re: word2pdf
Re: word2pdf
- Subject: Re: word2pdf
- From: Kevin Walzer <email@hidden>
- Date: Tue, 15 Nov 2005 13:53:49 -0500
- Organization: WordTech Software
Richard Brosnahan wrote:
I still haven't found a solution to work with Tiger (a requirement).
This script (below, from Michael Conner) doesn't address the "PDF" popup
menu in the print dialog, tho I did go down this road.
I'd much rather not depend on UI elements at all, and go straight to the
print services somehow.
Someone suggested Trapeze, which goes the other way (PDF -> Word)
Tried Strangelove, which does work, but not well enough. It loses a LOT
in translation. Headers, footers, embedded graphics all gone. Donno how
I'd script it, but perhaps a shell script would work. But the results
are not acceptable.
I'll report new stuff as I learn it.
I REALLY appreciate the response here!!
--Richard Brosnahan
Editor in Chief
Broz News
http://broznews.org
If you are losing a tug of war with a tiger, give him the rope before he
gets to your arm. You can always buy a new rope.
Max Gunther
On Nov 14, 2005, at 3:01 PM, email@hidden
wrote:
I don't have Tiger installed but in Panther the following script works.
tell application "Microsoft Word"
activate
end tell
tell application "System Events"
tell application process "Microsoft Word"
click menu item "Print..." of menu "File" of menu bar item
"File" of
menu bar 1
delay 1
click button "Save As PDFÅ " of UI element 4 of window "Print"
delay 2
click button "Save" of window "Save to File"
end tell
end tell
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
The command-line program "antiword" can do batch conversions of Word
file to postscript. See this page for information:
http://antiword.cjb.net/
You can download and compile the program yourself if you have the dev
tools installed, or use one of the GUI clients referenced under the
MacOS part of that page.
I did a little fooling around with it and developed this AppleScript
snippet to drive the conversion of one file:
set theFile to (choose file)
set uniXFile to POSIX path of theFile
set fileName to name of (info for theFile)
set psFile to "~/Desktop/" & fileName & ".ps"
do shell script "~/bin/antiword -p letter -i2 " & uniXFile & " > " & psFile
do shell script "pstopdf " & psFile & " -o ~/Desktop/" & fileName & ".pdf"
pstopdf is an Apple command-line tool to convert PS files to PDF, it
should already be on your system.
I suggest you play with the code above to loop through an entire
directory of Word files--shouldn't be too hard.
I didn't test the actual conversions extensively. It seems to work fine
for regular Word files; Word files with more elaborate setups (graphics,
etc.) were not as cleanly converted. It might be a matter of setting the
right flags with antiword. See the documentation ("antiword --help") for
more info.
Also, the GUI versions (one from Stone and one from Devonthink) might
work better/have more testing for clean conversions than the raw
command-line tool.
Hope this helps.
--
Cheers,
Kevin Walzer, PhD
WordTech Software - "Tame the Terminal"
http://www.wordtech-software.com
sw at wordtech-software.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
References: | |
| >Re: word2pdf (From: Richard Brosnahan <email@hidden>) |