You are not logged in.

#1 2010-11-05 07:13:06

zmyx
Member
Registered: 2009-11-05
Posts: 13
Website

[SOLVED] ps2pdf problem

I've got the following error while trying to convert a large .ps file (93 MB, generated from latex beamer class with embedded movie):

$ ps2pdf thesis_beamer.ps
Error: /undefined in 0000000000000000000000000000000000000000000001010000000010520a0000000000010101000000000000000001000000000000000000000000
Operand stack:
   0   0   0   0   0   0   0   0   0
Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   1894   1   3   %oparray_pop   1893   1   3   %oparray_pop   1877   1   3   %oparray_pop   1771   1   3   %oparray_pop   --nostringval--   %errorexec_pop   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--
Dictionary stack:
   --dict:1153/1684(ro)(G)--   --dict:1/20(G)--   --dict:88/200(L)--   --dict:197/300(L)--   --dict:96/200(L)--   --dict:244/300(L)--
Current allocation mode is local
Last OS error: 2
Current file position is 5356245
GPL Ghostscript  9.00: Unrecoverable error, exit code 1

However, when I try to convert another big .ps file (~200MB, generated from normal .tex document with no embedded movie) there was no problem.

Here is the list of some packages that I have in my system:

poppler-0.14.4-1
poppler-glib-0.14.4-1
poppler-qt-0.14.4-1
texlive-bin-2010.1-4
texlive-core-2010.19888-2
texlive-latexextra-2010.19882-1
texlive-science-2010.19845-1
ghostscript-9.00-1
gsfonts-1.0.7pre44-2

Any help would be appreciated.

Solution: I found out later that it's just the corrupted file problem. Probably in one of my graphic files which are used in the latex document.

Last edited by zmyx (2010-11-14 10:22:42)

Offline

#2 2010-11-05 08:47:51

boulde
Member
Registered: 2009-10-05
Posts: 41

Re: [SOLVED] ps2pdf problem

why don't you use pdflatex to generate directly the pdf ?

have you checked that you use the dvips option (from the beameruserguide):

4.3      Step Three: Creating a PDF or PostScript File
presen- Once a first version of the structure is finished, you should try to create a first PDF or PostScript file of your
tation (still empty) talk to ensure that everything is working properly. This file will only contain the title page and
        the table of contents.
    lyx Use "View" to check whether the presentation compiles fine. Note that you must put the table of contents inside
        a frame, but that the title page is created automatically.
        4.3.1     Creating PDF
presen- To create a PDF version of this file, run the program pdflatex on main.tex at least twice. You need to run it
tation twice, so that T X can create the table of contents. (It may even be necessary to run it more often since all
                         E
        sorts of auxiliary files are created.) In the following example, the greater-than-sign is the prompt.
        > pdflatex main.tex
              ... lots of output ...
        > pdflatex main.tex
              ... lots of output ...
        Alternatively, you can use lualatex or xelatex instead of pdflatex in above commands.
             You can next use a program like the Acrobat Reader, xpdf, evince or okular to view the resulting presen-
        tation.
        > acroread main.pdf
    lyx Choose "View pdf" to view your presentation.
        4.3.2     Creating PostScript
presen- To create a PostScript version, you should first ascertain that the hyperref package (which is automatically
tation loaded by the beamer class) uses the option dvips or some compatible option, see the documentation of the
        hyperref package for details. Whether this is the case depends on the contents of your local hyperref.cfg
        file. You can enforce the usage of this option by passing dvips or a compatible option to the beamer class
        (write \documentclass[dvips]{beamer}), which will pass this option on to the hyperref package.

             You can then run latex twice, followed by dvips.
        > latex   main.tex
              ... lots of output ...
        > latex   main.tex
              ... lots of output ...
        > dvips   -P pdf main.dvi
             The option (-P pdf) tells dvips to use Type 1 outline fonts instead of the usual Type 3 bitmap fonts. You
        may wish to omit this option if there is a problem with it.
             You can convert a PostScript file to a pdf file using
        > ps2pdf main.ps main.pdf

Last edited by boulde (2010-11-05 08:48:11)

Offline

#3 2010-11-05 12:15:45

linux-ka
Member
From: ADL
Registered: 2010-05-07
Posts: 232

Re: [SOLVED] ps2pdf problem

just try epstopdf from latex...http://www.ctan.org/tex-archive/support/epstopdf/ this works very well.

also my question. when creating your beamer presentation via latex, why don't you use pdflatex?

Offline

#4 2010-11-07 12:06:40

zmyx
Member
Registered: 2009-11-05
Posts: 13
Website

Re: [SOLVED] ps2pdf problem

Thanks for the suggestions and sorry for the late reply.

The reason I didn't use pdflatex is that all my graphics are in eps format. Perhaps it is time to try converting them to a format that is compatible with pdflatex.  If this work well then I can change my work flow in the future. I know I could have tried it earlier but it is just me who doesn't like to change the work flow if it is already does what I want.

Anyway I will be investigating this problem further if I have time. It used to work before but I don't know yet which new package(s) broke it.

Offline

#5 2010-11-07 12:10:18

linux-ka
Member
From: ADL
Registered: 2010-05-07
Posts: 232

Re: [SOLVED] ps2pdf problem

Why don't you use pdf-format for your grafics? This works very well!

Offline

#6 2010-11-08 08:19:59

zmyx
Member
Registered: 2009-11-05
Posts: 13
Website

Re: [SOLVED] ps2pdf problem

linux-ka wrote:

Why don't you use pdf-format for your grafics? This works very well!

I just have old graphic files (over 100 files) in eps format and I am not in the mood to convert them these days. But thanks for the tip, I will try it smile

Offline

#7 2010-11-08 16:57:19

linux-ka
Member
From: ADL
Registered: 2010-05-07
Posts: 232

Re: [SOLVED] ps2pdf problem

for name in *.pdf;do epstopdf "$name";done

if you loop in addition through each folder, it will be done fast.

Offline

#8 2010-11-09 06:16:04

quigybo
Member
Registered: 2009-01-15
Posts: 223

Re: [SOLVED] ps2pdf problem

If you specify the filename but not the extension in the \includegraphics{} command, then the interpreter (latex, pdflatex, lualatex etc) will find the appropriate format or convert it automagically as needed. No need to change your workflow.

edit: It seems pdflatex converts eps to pdf automatically but not lualatex.

edit2: If you were to change your workflow, may I recommend using make. Just specify that all eps files need to be converted to pdf before running latex, and then any pdf files that are older than their eps counterpart will be recreated for you.

Last edited by quigybo (2010-11-09 06:33:05)

Offline

#9 2010-11-09 16:20:40

frabjous
Member
Registered: 2010-07-13
Posts: 367

Re: [SOLVED] ps2pdf problem

linux-ka wrote:
for name in *.pdf;do epstopdf "$name";done

if you loop in addition through each folder, it will be done fast.

I think you mean:

for name in *.eps ; do epstopdf "$name" ; done

If you specify the filename but not the extension in the \includegraphics{} command, then the interpreter (latex, pdflatex, lualatex etc) will find the appropriate format or convert it automagically as needed. No need to change your workflow.

edit: It seems pdflatex converts eps to pdf automatically but not lualatex.

Yes, as of TeXlive 2010, you can use .eps figures directly with pdflatex. (Or earlier versions of TeXlive with the epstopdf package); all this actually does is run epstopdf on each one of the eps files and then includes it, but it's slightly more convenient possibly than doing it yourself (as above).

If you load the epstopdf package, you can also use .eps figures with LuaLaTeX, but you have to call it with the --shell-escape flag:

lualatex --shell-escape filename.tex

XeLaTeX also supports .eps directly these days, with no package needed (if my memory serves).

Offline

#10 2010-11-09 16:21:37

zmyx
Member
Registered: 2009-11-05
Posts: 13
Website

Re: [SOLVED] ps2pdf problem

quigybo wrote:

If you specify the filename but not the extension in the \includegraphics{} command, then the interpreter (latex, pdflatex, lualatex etc) will find the appropriate format or convert it automagically as needed. No need to change your workflow.

I tried this option and almost everything went well, that is, some eps files are not being converted properly. Anyway I can directly create new graphics in pdf format from now on.

Offline

#11 2010-11-09 16:24:05

frabjous
Member
Registered: 2010-07-13
Posts: 367

Re: [SOLVED] ps2pdf problem

zmyx wrote:

I tried this option and almost everything went well, that is, some eps files are not being converted properly. Anyway I can directly create new graphics in pdf format from now on.

If there are only a few that didn't convert well, you might try converting the others through Inkscape and see if it does any better.

Offline

#12 2010-11-09 22:55:07

quigybo
Member
Registered: 2009-01-15
Posts: 223

Re: [SOLVED] ps2pdf problem

frabjous wrote:

If you load the epstopdf package, you can also use .eps figures with LuaLaTeX, but you have to call it with the --shell-escape flag:

 lualatex --shell-escape filename.tex 

Thanks for that, I haven't used lualatex much and at first I couldn't find the man page (it is hiding under luatex).

frabjous wrote:

XeLaTeX also supports .eps directly these days, with no package needed (if my memory serves).

According to wikipedia (untested/unconfirmed), xelatex creates an intermediary dvi file, thus it is more similar to latex than pdflatex.

frabjous wrote:

If there are only a few that didn't convert well, you might try converting the others through Inkscape and see if it does any better.

Just to note here, inkscape can also be called on the command line without the need to open the gui:

 inkscape --export-text-to-path --export-area-drawing --export-eps=$@ --export-pdf=$(@:%.eps=%.pdf) $< 

As you can see I use this in my makefiles to convert to both eps and pdf, that way I have both formats available depending on which tex interpreter I am using. This will work for any format inkscape supports. For everything else there is imagemagick!

Offline

#13 2010-11-14 10:21:33

zmyx
Member
Registered: 2009-11-05
Posts: 13
Website

Re: [SOLVED] ps2pdf problem

I found out the cause of the error message in the first post--corrupted files!

I don't know which files and how but when I restore my backup files the process went well and ps2pdf generated no error. I cound have guessed earlier but sometimes I can really overlook such trivial thing.

However, I have learnt a lot of new things from this post, specially about pdflatex. Thank you for all the tips.

Offline

Board footer

Powered by FluxBB