4

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?

5
  • 2
    DVI can neither handle the PDF format, nor many graphics format allowed by pdflatex Feb 18, 2013 at 10:21
  • 1
    actually, I need to submit the DVI to the conference instead of PDF. I am wondering how should I generate DVI. Feb 18, 2013 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. Feb 18, 2013 at 11:02
  • 1
    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. Feb 18, 2013 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/ Feb 19, 2013 at 9:01

4 Answers 4

4

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"
7
  • I tried this convert utility already. It is losing the image quality to a great extent. Any suggestion on that? Feb 18, 2013 at 10:35
  • 2
    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, 2013 at 10:37
  • I used inkscape and got great results. Thanks a lot ! Feb 18, 2013 at 10:43
  • 1
    @Raj: See my update. You will get a high quality EPS. Feb 18, 2013 at 10:58
  • @egreg: I think pdf2ps does not exist. Feb 18, 2013 at 11:01
10

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}
1
2

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

You may use The Gimp to make the conversion.

4
  • PDF to EPS degrades image quality a lot. Do you know any good method for conversion, to not to loose the image quality? Feb 18, 2013 at 10:31
  • 1
    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). Feb 18, 2013 at 10:39
  • I used inkscape and got great results. Thanks a lot ! Feb 18, 2013 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. Feb 19, 2013 at 10:08
1

In case someone has the same problem again in the future.

For me it worked when I used \usepackage[dvips]{graphicx} instead of \usepackage[pdftex]{graphicx}

I was using TeXShop 3.51 on a Mac. What I also did was in TeXShop -> Preferences to go to Tab 'Typesetting' and Where it says 'Default Script' to select the radio button 'TeX+DVI' and then in the tab 'Engine' to click the checkbox 'Save Postcript File' under the 'TeX+dvips+distiller' menu.

Accepted from the IEEE PDF eXpress.

1
  • Actually, neither the dvips option nor pdftex should ever be explicitly set.
    – egreg
    May 1, 2015 at 13:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .