Graphics, Figures & Tablesdvi2pdf fail, but dvi2ps+ps2pdf works

Information and discussion about graphics, figures & tables in LaTeX documents.
moshiko
Posts: 30
Joined: Fri May 08, 2009 9:03 am

dvi2pdf fail, but dvi2ps+ps2pdf works

Post by moshiko »

Hi,

I have a pdf file (test1.pdf), which I converted to eps (test1.eps), using Adobe->Save as->eps option.
The pdf and the eps are attached in a zip file. if you open the eps in gsview you will see that for some reason the drawing is located down there..

I compiled the following code with latex, and got a good dvi:

Code: Select all

\documentclass{article}
\usepackage{graphicx}
\begin{document}
  \begin{figure}
   \includegraphics{test1.eps}
 \end{figure}
\end{document} 
next step, trying to convert to pdf. If I use dvi2pdf it runs for a second, close the window and complains on "Error code (1)" ???
The alternative, dvi2ps+ps2pdf works, but I want to understand what is the problem with the first option, and also in my full document this option generates slightly different fonts for the text. Thus, I would like to avoid the long way and make the dvi2pdf work.

I work with WinEdt v5.5 if that matters.

Please check the attached examples and let me know if you see the problem.

Already tried:
---------------
* convert the pdf to eps using gsview... generates poor output.
* the bounding box is correct (verified by Options->EPS clip is gsview). Don't know why the image was located so far away... I guess this causes the problem.

Thanks.
Attachments
problem.zip
zip file containing test1.pdf test1.eps
(83.18 KiB) Downloaded 204 times

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

dvi2pdf fail, but dvi2ps+ps2pdf works

Post by localghost »

I wonder why you convert the PDF file at all. Compiling with pdflatex allows to include graphics files with this format.


Best regards
Thorsten
moshiko
Posts: 30
Joined: Fri May 08, 2009 9:03 am

Re: dvi2pdf fail, but dvi2ps+ps2pdf works

Post by moshiko »

I am writing a professional paper.
The standard is to compile with latex and not pdflatex.
In addition, most of my figures are already in eps format, and pdflatex does not allow that...

I believe that the problem is in the position of the figure within the eps file... for some reason adobe saves the image in A0 media. I couldn't find any way to crop the eps around its bounding box. tried so many websites, but all the solutions simply didn't work.

please help.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

dvi2pdf fail, but dvi2ps+ps2pdf works

Post by localghost »

moshiko wrote:[...] The standard is to compile with latex and not pdflatex.
In addition, most of my figures are already in eps format, and pdflatex does not allow that [...]
Which source claims that compiling with latex is standard? If the final output format is PDF, you should compile directly with pdflatex. EPS files can be converted with the command line tool epstopdf or with the epstopdf package "on the fly".
moshiko
Posts: 30
Joined: Fri May 08, 2009 9:03 am

Re: dvi2pdf fail, but dvi2ps+ps2pdf works

Post by moshiko »

First of all - You are right ! Indeed, after changing all eps to pdf and compiling with PDFLatex it works fine.

However, I am not sure if this solves the problem completely. When I upload my tex file to arXiv.org their scripts run latex, and thus will fail if I don't supply the eps files. This is just a technical issue, but there should be a way to handle everything with eps only - right?

I always thought that the conversion between pdf and eps is transparent and easy. This is the first time I encounter problem with these file types.

I think that an eps whose bounding box appears somewhere within an A0 media is something that should be fixed anyhow. I will appreciate any help.

thank again.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

dvi2pdf fail, but dvi2ps+ps2pdf works

Post by localghost »

It's astonishing but the Adobe products often cause problems when converting between their homemade formats. Try the conversion with Ghostscript/GSview. This seems much more reliable.
moshiko
Posts: 30
Joined: Fri May 08, 2009 9:03 am

Re: dvi2pdf fail, but dvi2ps+ps2pdf works

Post by moshiko »

I tried that direction... I used gsview and "File->Convert..." to save as eps, but the output had poor quality, and it did not solve the problem I described above.

thank you for all the help.
I hope that someone will come with an easy solution.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

dvi2pdf fail, but dvi2ps+ps2pdf works

Post by localghost »

My last idea is correct the bounding box of the EPS files maually. Every EPS file can be opened with a simple text editor. Thre you can edit the comment section right at the beginning of the file.

Code: Select all

%!PS-Adobe-3.0 EPSF-3.0
%%Title: (No Title)
%%Version: 1 3
%%Creator: Adobe Acrobat 7.0
%%CreationDate: 23:03:44 06/24/09
%%For: (Windows 9x/NT/2000/XP User)
%%DocumentData: Clean7Bit
%%LanguageLevel: 2
%%ADO_ContainsXMP: MainFirst
%%BoundingBox: 42 1482 294 1630
%%HiResBoundingBox: 41.667 1481.91 293.753 1629.83
%%Pages: 0
%%DocumentProcessColors: Cyan Magenta Yellow Black
%%DocumentNeededResources: (atend)
%%DocumentSuppliedResources: (atend)
%%EndComments
The values (llx, lly, urx, ury) for BoundingBox and HiResBoundingBox are much too high and result in a weird paper format where the actual image is located near the upper left corner of the page. Usually it is placed near the lower left corner. But all this should be no big deal. The compilation route DVI -> PDF works fine for me on Linux. I may test it later on Windows.

Perhaps you can choose some appropriate settings in Acrobat when converting the PDF files. Otherwise you have to do it manually.

Finally another suggestion. In case all your images are as simple as the sample file, you should think about using pstricks(-add) and related packages like pst-circ (if allowed).


Supplement:
I found some interesting remarks concerning pdfLaTeX on arXiv.org about submitting papers [1]. This should be of interest for you.

[1] arXiv.org Help - Considerations for PDFLaTeX submissions
moshiko
Posts: 30
Joined: Fri May 08, 2009 9:03 am

Re: dvi2pdf fail, but dvi2ps+ps2pdf works

Post by moshiko »

Fixing the bounding box numbers won't help since if I change it the box will not contain the image. Tried it.

I know that missing bounding box numbers can be a major source for troubles, and usually one fixes it manually.
However, in my scenario the bounding box numbers are fine. In GSview, options->"show bounding box" it seems that everything is fine. I do agree that the numbers are quite large and that this causes the media paper to be so large as well. But this was automatically generated by adobe! I tried to trick with the saving settings inside adobe, but there were not too many options, and neither worked.

I can't figure out why adobe have implemented the "save as" options so badly...
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

dvi2pdf fail, but dvi2ps+ps2pdf works

Post by localghost »

moshiko wrote:Fixing the bounding box numbers won't help since if I change it the box will not contain the image. Tried it. […]
This was an idea before I downloaded and extracted the archive you attached. It caused me some trouble to extract it but while writing my last reply I got it working.

I now tested your example on my Windows system with MiKTeX 2.7 and did a successful compilation with latex and conversion with dvipdfmx to PDF. It works fine for me independent from the OS.

Trying to view the EPS file from your archive, I get a warning from GSview.
Warning caused by the included EPS file.
Warning caused by the included EPS file.
GSview-warning.png (4.81 KiB) Viewed 7228 times
This is caused by the default A4 paper format. Viewing only the EPS clip lets the image appear.

I suggest to submit the paper with the attached EPS files as is or see my final remarks in the last reply.
Post Reply