Link to home
Start Free TrialLog in
Avatar of chr00t
chr00t

asked on

inserting inline .eps file with enscript

I'm trying to get a company logo printed inline with text via enscript and having no luck, hoping someone can help. See code below:
cat $1 |enscript -e^@epfs[c]{cheape.eps} -q -l -f Courier8 --margins=0:0:0:0 -r -p -|ps2pdf13 -|cat - > /tmp/gertest.pdf

Open in new window

SOLUTION
Avatar of ewest02
ewest02
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of chr00t
chr00t

ASKER

Thanks ewest02, would you mind attaching your mylog.txt file so I can see it. I did the ^@ in vi like you said: Ctrl-v Ctrl-0 Ctrl-0 Ctrl-0, then typed: epsf[c]{test2.eps} after that, but when I look @ my mylogo.txt, I dont see anything before the: epsf[c]{test2.eps} & I did do: Ctrl-v Ctrl-0 Ctrl-0 Ctrl-0 (using #0).  I'm attaching my mylogo.txt so you can see what I mean
mylogo.txt
Avatar of chr00t

ASKER

Any help would be greatly appreciated. If you print your *nix reports
with a logo in another manner, I'd love to hear your solutions as well.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Ahh. I was going to suggest writing this directly in PostScript, but that will work as well. Per your request I am attaching the text file containing the embedded EPS directive.

The trick with enscript is getting an escape character into the text stream. Here is the view of the attached file via od:

> od -c foo.txt
0000000  \0   e   p   s   f   [   c   ]   {   f   o   o   b   a   r   .
0000020   e   p   s   }  \n
0000025

Note the \0 that precedes the directive.

Pretty simple then to just cat this file along with the target text file to a pipe with the enscript command line.
      cat foo.txt xxx.txt|enscript -e -vB -p - |ps2pdf13 - bar.pdf
foo.txt