cmiller2005:
Let's take a step back for a moment. What is it you're trying to do? If you're trying to get to an EPS file, you likely don't even need Word and may be overcomplicating things. Give me an overview of what you're trying to do, and maybe I can offer some advice on how to get from 'here' to 'there'.
I've never used Postscript::Simple before (or have forgotten it if I did), so I couldn't speak to merging text into an .eps file. But do you even need an .eps file, or is that just another step on the way to what you're trying to do?
...roboticus
When your only tool is a hammer, all problems look like your thumb.
| [reply] |
Well, this is a sort of test for an entry level programming job I applied for. The guy sent me two assignments, the first was to do a mail merge with an Excel spreadsheet and a Word document. I accomplished that fairly easily, it had been a while though. Below is the second assignment.
Perl programming:
a. Save the data in the spreadsheet above to a tab delimited file.
b. Save the Word document template above to a PostScript EPS file.
c. Using the PostScript::Simple module, write a Perl script that merges the template with the data from the tab delimited file.
d. I’d like to see the Perl code, input data, EPS file, and the final output.
So, in reading over the documentation for Postscript::Simple it just didn't seem like the right module to do the job, but again, I am not that familiar with Perl and the guy knows this. From what I saw in the forums etc. and Google searches Win32::OLE seemed the best way to come close to what he is looking for, hence my previous post on doing a mail merge in Perl. But, in re-reading his instructions it seems he wanted the template converted to EPS format and THEN merge that with the tab delimited text file. I am assuming this would then produce the merged documents in EPS format also, although I am not altogether sure about this. I hope this makes sense.
Thanks for your replies and advice
Carl
| [reply] |
Postscript is a page description scripting language. In one sense it's just text. If you have a PS version of the original Word template and the PS includes place holder text for the merge fields then the job "simply" becomes: use Perl to replace the merge fields in the template PS file with the merge field entries from the input data.
I've never used PostScript::Simple nor looked at it. However Perl is pretty good at manipulating text files and both the PS and input data files are text so maybe you don't need the module, or maybe the module makes life easier. Kinda sounds like your job to find out :-D.
Seems to me the exercise isn't about Perl, but is more a test of your programming skills which ought to transcend the specific tools you are asked to use.
Perl is the programming world's equivalent of English
| [reply] |
cmiller2005:
OK, then, use Win32::OLE to save the document as an .EPS file. The Postscript::Simple module has an importeps method that apparently lets you put an EPS image on the same page. So you can create some postscript with your perl script, then import your template on top of it. I think that ought to work.
Take a look at the example.pl script that comes with Postscript::Simple, it may give you the push you need.
...roboticus
When your only tool is a hammer, all problems look like your thumb.
| [reply] [d/l] |