In Karmic, LyX cannot find included pdf file (pdfpages)

Bug #461996 reported by Emanuele Gissi
44
This bug affects 7 people
Affects Status Importance Assigned to Milestone
LyX
Fix Released
Unknown
lyx (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: lyx

1) create a new lyx document and save it
2) Insert > File > External material
3) Browse to a pdf file and push OK button

The pdf file is not shown.
"Error converting to loadable format"

4) push "view PDF" button (pdflatex)

A latex error window is raised:
Package pdfpages Error: "Cannot find file '1_home_egissi_test'
Undefined control sequence
...

\includepdf{1_home_egissi_test}

...

I am at disposal for further analysis.
Emanuele Gissi

Revision history for this message
Emanuele Gissi (emanuele-gissi-gmail) wrote :

I reinstalled Ubuntu Karmic on various computers and I confirm the bug.
This is a regression, LyX worked perfectly on Jaunty.
I am at disposal.
Emanuele Gissi

Revision history for this message
Emanuele Gissi (emanuele-gissi-gmail) wrote :

I forgot to write the error message that LyX is sending to the shell:

   **** Page has no /MediaBox attribute. Using the current page size.
Error: /stackunderflow in --run--
Operand stack:
   --dict:5/5(L)-- 595.0 842.0 3
Execution stack:
   %interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1862 1 3 %oparray_pop 1861 1 3 %oparray_pop 1845 1 3 %oparray_pop --nostringval-- --nostringval-- 2 1 1 --nostringval-- %for_pos_int_continue --nostringval-- --nostringval--
Dictionary stack:
   --dict:1159/1684(ro)(G)-- --dict:1/20(G)-- --dict:75/200(L)-- --dict:75/200(L)-- --dict:106/127(ro)(G)-- --dict:285/300(ro)(G)-- --dict:21/25(L)-- --dict:2/6(L)--
Current allocation mode is local
GPL Ghostscript 8.70: Unrecoverable error, exit code 1
convert: Postscript delegate failed `/tmp/lyx_tmpdir.TJ3187/gconvert0.Zb3187.pdf': No such file or directory @ pdf.c/ReadPDFImage/612.
convert: missing an image filename `ppm:/tmp/lyx_tmpdir.TJ3187/CacheItem.wX3187.ppm' @ convert.c/ConvertImageCommand/2775.
/usr/share/lyx/scripts/convertDefault.py ERROR
Execution of "convert" failed.

Revision history for this message
Emanuele Gissi (emanuele-gissi-gmail) wrote :

I worked on the bug.
1) I tracked the visualization problem to the LyX script convertDefault.py
The convert command from Imagemagick is called to convert the pdf image to ppm.

This is an example of convert command, that LyX script sends to os.system() function:

convert -define pdf:use-cropbox=true -depth 8 -flatten "pdf:/tmp/lyx_tmpdir.TJ3247/gconvert0.Ti3247.pdf" "ppm:/tmp/lyx_tmpdir.TJ3247/CacheItem.kn3247.ppm"

If I modify it in (delete -define option):

convert -depth 8 -flatten "pdf:/tmp/lyx_tmpdir.TJ3247/gconvert0.Ti3247.pdf" "ppm:/tmp/lyx_tmpdir.TJ3247/CacheItem.kn3247.ppm"

then the pdf preview works.

2) The final PDF document is still not produced.

A latex error window is raised:
Package pdfpages Error: "Cannot find file '1_home_egissi_test'
Undefined control sequence
...

\includepdf{1_home_egissi_test}

...

3) Instead, if I export to tex and run pdflatex newfile1.tex from the command line everything works well

Revision history for this message
ratoune (s-teinturier) wrote :

I had the same problem with Karmic. I've solved it like this:
- uninstall Lyx (synaptic)
- install deb package Lyx 1.6.4.1 which is on getdeb.net... It's a package for Jaunty! But it works... till now!

I have to run Lyx through the terminal (no icon in the Applications menu).

2 bugs disappeared
- export to pdf view
- integration of external pdf files in the final pdf

Revision history for this message
tjbk_tjb (tjbk123) wrote :

I've also had the same problem after upgrading to Karmic. A hack that I used to get a single file I needed by tomorrow worked as follows:
1. Start Lyx in a terminal with the LaTeX debug flag: "lyx -dbg 128 Lab6.lyx"
2. Open the problematic document.
3. Attempt to compile (is that the correct word?) it with pdflatex.
4. Note the file reported missing.
5. Copy the needed PDF to a directory like /tmp/lyx_tmpdir.*/lyx_tmpbuf0/, which should contain all of the other files.
6. Rerun the compilation using pdflatex.

I'm not sure if this will work all of the time, but it may tide some people over until then.

Attached is a log file of a run of Lyx with a simple file containing nothing but a simple instance of a W-4 form PDF embedded in a Lyx document with no options.

Revision history for this message
tjbk_tjb (tjbk123) wrote :

Here's the same log file compressed and in TXT format for, hopefully, easy browsing.

arno_b (arno.b)
Changed in lyx (Ubuntu):
status: New → Confirmed
Revision history for this message
WolphFang (mjoyner-vbservices) wrote :

Affects both 32-bit and 64-bit equally it seems.

Revision history for this message
WolphFang (mjoyner-vbservices) wrote :

According to a post on <email address hidden>, this issue has been fixed in 1.6.5:

=============================================================================
Date: Tue, 8 Dec 2009 09:09:56 +0100
From: <email address hidden>
To: <email address hidden>
Subject: Re: Lyx 1.6.4, pdfpages, when clicking on view PDF, either embedded pdfs aren't found or 100% cpu from pdflatex

Niklas Huldén wrote:
> > I can confirm the latter also on OpenSuSE 11.2 (LyX 1.6.4.2). Imbedded
> > pdf:s show up in LyX but compiling the document fails after not finding
> > the pdf-files in the temporary directory. Manually exporting to tex and
> > compiling works.

This has been fixed in 1.6.5.

Jürgen
=============================================================================

Revision history for this message
arno_b (arno.b) wrote :

It does not concern lyx but Ghostscript:
http://<email address hidden>/msg77662.html

Moreover, I use 1.6.5 on Karmic and the issue is still here.

Revision history for this message
Keith (keith-buck) wrote :

I have very similar symptoms. (view pdf button hangs Lyx, and I have to forcefully kill the window.)

Lyx 1.6.4 on Karmic. I was able to export to plain tex, then pdflatex on the command line a couple of times and it produced correct pdf output, including the embedded pdf file. It gave a warning:

pdfTeX warning: pdflatex (file ./filename.pdf): PDF inclusion: found PDF version <1.6>, but at most version <1.4> allowed.

So I am about to see if I can convert back to pdf 1.4 and see if that helps.

-Keith

Revision history for this message
Keith (keith-buck) wrote :

Update: converted to pdf 1.4 using pdf2ps and ps2pdf. That worked to do the conversion and remove the error message, but lyx still hangs and leaves pdflatex running in the background consuming cpu.

-Keith

Revision history for this message
Keith (keith-buck) wrote :

As a workaround I converted from pdf to ps to eps (pdf2ps, ps2eps) and then inserted the resulting files. That seems to work with no hangs.

-Keith

Revision history for this message
Keith (keith-buck) wrote :

Even better was to use pdftk to split the few multi-page pdfs into individual pages, and then just inserted individual pages as graphics. The eps was cutting off extra margins for some reason.

Hope these ideas help someone else.

-Keith

Revision history for this message
WolphFang (mjoyner-vbservices) wrote :

Attempting to install latest LyX for Lenny backports from http://backports.org/

Downloaded packages: ttf-lyx, lyx-common, lyx

Revision history for this message
WolphFang (mjoyner-vbservices) wrote :

from command prompt ran: "dpkg -i *lyx*deb" to upgrade inplace.

It all now *WORKS*.

Revision history for this message
ratoune (s-teinturier) wrote :

Lyx 1.6.5 is now available for ubuntu 9.10: there's a package from getdeb website.
See also this link:
http://tobal.cymaho.com/?p=1196

Great!

Revision history for this message
Danilo Piazzalunga (danilopiazza) wrote :

The fix is trivial, see http://www.lyx.org/trac/ticket/6345.

As a workaround, one can add the fix for this bug by editing /usr/share/lyx/external_templates. Just see the attached patch and apply it on your installation (it just adds one line to /usr/share/lyx/external_templates).

Revision history for this message
arno_b (arno.b) wrote :

With the fix I still have a: "Error converting to loadable format" in lyx for pdf pictures.
despite I cannot see pdf pictures in lyx since Karmic, I never had problem to export as pdf using pdflatex as the reporter of this bug has.
Maybe these two problems do not come from the same issue.

Changed in lyx:
status: Unknown → Fix Released
Revision history for this message
Danilo Piazzalunga (danilopiazza) wrote :

LyX simply cannot display PDF pages, but this is a different issue.

This bug can only be seen when previewing the generated PDF from within LyX; exporting to LaTeX and then generating a PDF is not affected.

tags: added: patch
Revision history for this message
Nigel Babu (nigelbabu) wrote :

This bug has been fixed in Lyx 1.6.5, changing to Fix Released.

tags: added: patch-accepted-upstream
removed: patch
Changed in lyx (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
WolphFang (mjoyner-vbservices) wrote : Re: [Bug 461996] Re: In Karmic, LyX cannot find included pdf file (pdfpages)

Nigel Babu wrote:
> This bug has been fixed in Lyx 1.6.5, changing to Fix Released.
>
> ** Tags added: patch-accepted-upstream
> ** Tags removed: patch
>
> ** Changed in: lyx (Ubuntu)
> Status: Confirmed => Fix Released
>
>
Is the package available for Ubuntu yet?

--
LyX: http://www.lyx.org/ OpenOffice: http://www.openoffice.org/
Inkscape: http://www.inkscape.org/ Scribus: http://www.scribus.net/
GIMP: http://www.gimp.org/ PDF: http://www.pdfforge.org/

Revision history for this message
ratoune (s-teinturier) wrote :

Nigel,

Lyx 1.6.5 is available as a deb package on getdeb, for Ubuntu 9.10.
I have no more problem with PDF files with this Lyx version.

The next Ubuntu 10.04 should include TeX Live 2009 and Lyx 1.6.5 in its repositories, as far as I know...

Revision history for this message
Nigel Babu (nigelbabu) wrote : Re: [Bug 461996] Re: In Karmic, LyX cannot find included pdf file (pdfpages)

The new package will be available in Lucid. Please see
http://packages.ubuntu.com/lucid/lyx

On Sat, Mar 20, 2010 at 3:18 PM, ratoune <email address hidden> wrote:

> Nigel,
>
> Lyx 1.6.5 is available as a deb package on getdeb, for Ubuntu 9.10.
> I have no more problem with PDF files with this Lyx version.
>
> The next Ubuntu 10.04 should include TeX Live 2009 and Lyx 1.6.5 in its
> repositories, as far as I know...
>
> --
> In Karmic, LyX cannot find included pdf file (pdfpages)
> https://bugs.launchpad.net/bugs/461996
> You received this bug notification because you are a direct subscriber
> of the bug.
>
> Status in LyX - The Document Processor: Fix Released
> Status in “lyx” package in Ubuntu: Fix Released
>
> Bug description:
> Binary package hint: lyx
>
> 1) create a new lyx document and save it
> 2) Insert > File > External material
> 3) Browse to a pdf file and push OK button
>
> The pdf file is not shown.
> "Error converting to loadable format"
>
> 4) push "view PDF" button (pdflatex)
>
> A latex error window is raised:
> Package pdfpages Error: "Cannot find file '1_home_egissi_test'
> Undefined control sequence
> ...
>
> \includepdf{1_home_egissi_test}
>
> ...
>
> I am at disposal for further analysis.
> Emanuele Gissi
>
> To unsubscribe from this bug, go to:
> https://bugs.launchpad.net/lyx/+bug/461996/+subscribe
>

Revision history for this message
ratoune (s-teinturier) wrote :

Thanks, excuse-me Nigel, the precedent message was an answer to WolphFang of course...

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.