# Latex or PdfLatex to generate DVI

I would like to generate DVI output using latex or pdflatex, it doesn't matter. First, I would like to mention that I run the following command to compile my document and it runs successfully -

pdflatex -shell-escape -synctex=1 report.tex

Now if I wanted to have a DVI on the same file, I run the following command -

latex report.tex

I get the following error -

! LaTeX Error: Cannot determine size of graphic in platform.pdf (no BoundingBox ).

Just to mention that the figure platform.pdf is in pdf format which is generated using other image editing software (Microsoft Visio).

I also tried to add %&latex on the first line.

How should I solve this problem?

-
DVI can neither handle the PDF format, nor many graphics format allowed by pdflatex –  Lionel MANSUY Feb 18 '13 at 10:21
actually, I need to submit the DVI to the conference instead of PDF. I am wondering how should I generate DVI. –  Raj Feb 18 '13 at 10:23
@MartinSchröder: That link explains why Raj faced that problem, but since the error message suggests there's a particular problem with this PDF message, rather than the program not handling PDF at all, the equivalence of the two problems isn't clear. I'd rather have this not be a duplicate. –  Charles Stewart Feb 18 '13 at 11:02
if you have a conference that specifies DVI, it might be a good idea to get one of the "great and good" to point out to them that it's not a good idea. this issue with image formats is only one of the many that can arise for a scholar trying to prepare a paper for such a conference. –  wasteofspace Feb 18 '13 at 19:06
Well, its exactly the PDF eXpress tool of IEEE which needs this. The latex source must have DVI included is their requirement. You can have a look here http://www.pdf-express.org/ –  Raj Feb 19 '13 at 9:01

latex.exe cannot compile a TeX input file that imports either PDF, PNG, or JPG images. Instead, latex.exe can only compile a TeX input file that imports EPS images.

See the Ulrike Fischer's answer or Martin Schroder's comment for the correct statement.

To convert PDF to EPS, you can use pdftops as follows:

 pdftops -f 1 -l 1 -eps "input.pdf"  "output.eps"

-
I tried this convert utility already. It is losing the image quality to a great extent. Any suggestion on that? –  Raj Feb 18 '13 at 10:35
Rather than convert, I'd suggest pdf2ps that uses Ghostscript. But probably PDF was not the best format to begin with, if the contents is an image. –  egreg Feb 18 '13 at 10:37
I used inkscape and got great results. Thanks a lot ! –  Raj Feb 18 '13 at 10:43
@Raj: See my update. You will get a high quality EPS. –  In PSTricks we trust Feb 18 '13 at 10:58
@egreg: I think pdf2ps does not exist. –  In PSTricks we trust Feb 18 '13 at 11:01

Actually LaTeX itself can handle every image format if you tell it the size of the graphics:

\documentclass[]{scrreprt}
\usepackage{graphicx}

\begin{document}
\fbox{\includegraphics[bb=0 0 200 200]{unknown.imgformat}}

\end{document}


The dvi doesn't contain the actual image but only a reference, a "link". So it doesn't matter that it doesn't exist. The problems start when you try to view, print or convert to pdf: Then the dvi driver needs to find the image and also must be able to handle it.

Btw: This also means that it is not enough to send a dvi to someone else. You should also sent every image.

The most used dvi driver, dvips can handle eps and in some variants jpg. With dvipdfmx it is also possible to use e.g. pdf:

\documentclass[]{scrreprt}
\usepackage[dvipdfm]{graphicx}

\begin{document}
\fbox{\includegraphics[scale=0.5,bb=0 0 600 850]{tiger.pdf}}

\end{document}

-
See also Heiko’s answer: Graphics file extensions and their order of inclusion when not specified. –  Speravir Feb 18 '13 at 23:06

According to this link, you have to convert the PDF to PS or EPS format.

You may use The Gimp to make the conversion.

-
PDF to EPS degrades image quality a lot. Do you know any good method for conversion, to not to loose the image quality? –  Raj Feb 18 '13 at 10:31
You may play with the resolution; PDF to EPS seems to loose the vector format as you convert the PDF to a raster format. Try using a "big" resolution (like 300, 600 or 1200 dpi). –  Lionel MANSUY Feb 18 '13 at 10:39
I used inkscape and got great results. Thanks a lot ! –  Raj Feb 18 '13 at 10:46
Converting your PDF to PostScript is only needed if you use dvips or another device driver that does not handle PDFs. But there's still dvipdfm, which can handle PDFs. –  Martin Schröder Feb 19 '13 at 10:08