• Status: Solved
• Priority: Medium
• Security: Public
• Views: 995

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

0
chr00t
• 3
• 2
2 Solutions

Commented:
I tried to get this to work ... alas there was no joy in Mudville. It seems that enscript really wants a control char that can not be entered on the command line. I did find that I could create a text file, mylogo.txt with the escape sequence
^@epsf[c]{mylogo.eps}
and then run

cat mylogo.txt some_text.txt | enscript -e -B -p - |ps2pdf13 - bar.pdf

That worked....

Note that the ^@  in the text file is type in vi with Ctrl-v Ctrl-0 Ctrl-0 Ctrl-0
Those are zeros not the letter 0.

0

Author Commented:
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
0

Author Commented:
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.
0

Author Commented:
I found a solution thanks to my local linux user group: FLUX (flux.org). Member Kwan Lowe sent me the following:

I have done a similar thing to generate some automated PDFs. I used m4
and tex to do it...

--Example Report--
\documentclass[a4paper,10pt]{report}
\usepackage{graphicx}
\usepackage{eso-pic}

% Title Page
\title{TPS Report}
\author{Bob}

\begin{document}
\maketitle

\begin{abstract}
This is the TPS report to be submitted in triplicate to the three bosses.
\end{abstract}

\begin{center}
\includegraphics[width=120mm,bb=0 0 808 660]{Diagram1.png}
\end{center}

\begin{verbatim}
NEWS
The quick brown fox jumped over the lazy dogs.

\end{verbatim}
\end{document}

--End TPS Report--

You can create an m4 template from the above, then just use it as a
wrapper to your report.  You may need to escape certain sequences in
the report text. If so, pipe it through sed to escape symbols like @,
for example.

Once complete you can run it through pdflatex to generate a PDF file.
0

Commented:
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
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.