My experiences trying to embed MS Visio diagrams into LaTeX documents:
1. In Windows, install a postscript printer driver
I tried the Adobe generic PS driver, which didn't result in nice fonts. Much better worked a genuine HP printer driver, the HP Color LaserJet 4550 PS. Be careful to select FILE: as printer port!
2. Print to this printer
I didn't experiment with the postscript options of the printer driver so far. You will be asked for a filename, don't forget to explicitly add the extension .eps.
3. Transfer the file to your Linux machine
4. Cleanup the EPS
The EPS file coming from the printer driver still needs a bit tweaking. First of all, there was some garbage at the beginning of the file, I had to delete these lines of binary stuff before the actual header line "%!PS-Adobe-3.0" (you can just use any text editor to edit Postscript files):
^[%-12345X@PJL JOB
@PJL SET HOLD=OFF
@PJL ENTER LANGUAGE = POSTSCRIPT
Then there were those annoying postscript messages everytime the file was viewed. So I got rid of these three lines:
statusdict begin (%%[ ProductName: ) print product print ( ]%%)= flush end
(%%[Page: 1]%%) =
(%%[LastPage]%%) =
The first one is rather at the begining of the document, the other two rather at the end.
The only thing that is still missing is the bounding box of the diagram - we still have an entire page.
5. Add the bounding box
Use gs to find out the bounding box:
gs -sDEVICE=bbox -dNOPAUSE -dBATCH file.eps
You will get something like this:
ESP Ghostscript 8.15 (2004-09-22)
Copyright (C) 2004 artofcode LLC, Benicia, CA. All rights reserved.
This software comes with NO WARRANTY: see the file COPYING for details.
Loading NimbusMonL-Regu font from /usr/share/ghostscript/fonts/n022003l.pfb... 3176848 1679759 1525176 234272 1 done.
%%BoundingBox: 82 544 412 823
%%HiResBoundingBox: 82.384943 544.120366 411.240292 822.161155
Now just take the last but one line and add it to the EPS file, at the beginning somewhere before this line
%%EndComments
There might already be a line like
%%BoundingBox: (atend)
In this case, just replace this line.
Now you should have an EPS file which can be included in a LaTeX document and also converted to pdf by epstopdf without complaints.
Note: I tried eps2eps, which greatly reduced the file size, but the fonts looked really ugly then.
Roman Schindlauer Last modified Sun Oct 8, 2006