[gutsy] [regression] pdf rendering not working

Bug #137944 reported by Vincenzo Ciancia
10
Affects Status Importance Assigned to Milestone
xournal (Ubuntu)
Fix Released
Undecided
Vincenzo Ciancia
Nominated for Gutsy by Vincenzo Ciancia

Bug Description

Binary package hint: xournal

I thought this only was a bug with 0.4 version, but xournal is no longer importing pdfs in gutsy even in its 0.3.3 version (currently in the archives). It worked like a charm in feisty with the same version.

Related branches

Revision history for this message
khul (klas-hultqvist) wrote :

The cause of this problem is that xournal uses pdftoppm, to convert individual pages
in the pdf file to bit maps. The old version of pdftoppm named the bit map files with
six-digit page numbers irrespective of the number of pages in the pdf document. The new version uses the number of digits needed for the largest page number, e.g. three if the number of pages is in the range 100 to 999 inclusive.

I replaced the lines

  ppm_name = g_strdup_printf("%s/p-%06d.ppm", bgpdf.tmpdir, req->pageno);
  ...
  pixbuf = gdk_pixbuf_new_from_file(ppm_name, NULL);

in xo-file.c, with a bit of logic to try different number of digits (from 1 to 4) and look for a non-null pixbuf. It works.

Revision history for this message
Vincenzo Ciancia (vincenzo-ml) wrote :

Another solution would be to use pdfinfo (included in poppler-utils just like pdftoppm), to find the number of pages of the document, or to just find the maximum in the directory. I have opened a bug upstream, which I am going to link. Khul, can you produce a debdiff? If not, please post a patch or just cut and paste code here, so that we have an implemented fix at least. Thanks a lot.

Revision history for this message
Vincenzo Ciancia (vincenzo-ml) wrote :
Revision history for this message
Vincenzo Ciancia (vincenzo-ml) wrote :

Upstream developer "aurox" provided a patch that works. I already have a package that works, but am unsure about how to add the patch to xournal sources: upstream stable release lacks the fix, so it should be provided as a separate patch in the "debian" directory. Any pointers to relevant documentation?

Revision history for this message
khul (klas-hultqvist) wrote :

I'm not so familiar with using debian packages, but here is the code in xournal-0.4/src/xo-file.c after my changes:

  ppm_name = g_strdup_printf("%s/p-%04d.ppm", bgpdf.tmpdir, req->pageno);
// printf("Child %d finished, should look for %s... \n", pid, ppm_name);

  if (bgpdf.status == STATUS_ABORTED || bgpdf.status == STATUS_SHUTDOWN)
     pixbuf = NULL;
  else {
     pixbuf = gdk_pixbuf_new_from_file(ppm_name, NULL);
     if(pixbuf == NULL) {
       ppm_name = g_strdup_printf("%s/p-%03d.ppm", bgpdf.tmpdir, req->pageno);
       pixbuf = gdk_pixbuf_new_from_file(ppm_name, NULL);
     }
     if(pixbuf == NULL) {
       ppm_name = g_strdup_printf("%s/p-%02d.ppm", bgpdf.tmpdir, req->pageno);
       pixbuf = gdk_pixbuf_new_from_file(ppm_name, NULL);
     }
     if(pixbuf == NULL) {
       ppm_name = g_strdup_printf("%s/p-%01d.ppm", bgpdf.tmpdir, req->pageno);
       pixbuf = gdk_pixbuf_new_from_file(ppm_name, NULL);
     }
  }

It's pretty clumsy, and assumes no more than 9999 pages.

Revision history for this message
Vincenzo Ciancia (vincenzo-ml) wrote :

khul: upstream provided a fix so we will use that, sorry for wasting your time. If you have i386 you can check the binary package I provided at

http://www.di.unipi.it/~ciancia/content/deb/xournal_0.4.0.1ubuntu1_i386.deb

It can't be uploaded in this state, since I applied the patch directly, but it should work reasonably, let me know.

Revision history for this message
Vincenzo Ciancia (vincenzo-ml) wrote :

xournal (0.4.0.1ubuntu1) gutsy; urgency=low

  * New upstream release.
  * debian/docs: Add html-doc.
  * debian/xournal.desktop: add mimetype application/pdf which is handled by xournal.
  * Fixes (LP: #95045)
  * Fixes (LP: #134475)
  * Fixes (LP: #137944)
  * Fixes (LP: #137934)
  * Fixes (LP: #137935)

 -- Vincenzo Ciancia <email address hidden> Fri, 07 Sep 2007 12:26:22 +0200

Changed in xournal:
status: New → Fix Released
Revision history for this message
Vincenzo Ciancia (vincenzo-ml) wrote :

LP closes bugs that are claimed fixed in PPAs, this is a bug in launchpad. Didn't mean to mark the bug as fixed.

Changed in xournal:
status: Fix Released → New
Revision history for this message
Andrew Frank (frank-geoinfo) wrote :

just installed it - it works and fixes the problems i had.

i think you can close the bug after it has been included in the distro
thank you all for the diligent actions!

and providing the link to the .deb archive was an enormous help!

Revision history for this message
Andrew Frank (frank-geoinfo) wrote :

but - afterthough - it is worth to check the packaging:
why could pdftoppm be removed by apt-get ?
apt-get should know that xournal depends on it?

anything incorrectly set there?
just a guess....

andrew

Revision history for this message
Vincenzo Ciancia (vincenzo-ml) wrote :

Andrew: xournal depends on poppler-utils (containing pdftoppm) in both versions of xournal. Something odd must have happened in your installation, or maybe you had a local copy of xournal installed (e.g. in /usr/local) and apt removed the ubuntu copy of xournal itself?

Changed in xournal:
assignee: nobody → vincenzo-ml
Revision history for this message
Vincenzo Ciancia (vincenzo-ml) wrote :

xournal (0.4.1-0ubuntu1) gutsy; urgency=low

  * New upstream release
    Fixes (LP: #95045)
    Fixes (LP: #134475)
    Fixes (LP: #137934)
    Fixes (LP: #137944)
  * Replace ubuntu shipped .desktop file with the upstream provided one.
  * Install application and mimetype icons in proper directories
  * debian/docs: Add html-doc.

 -- Vincenzo Ciancia <email address hidden> Tue, 18 Sep 2007 14:04:07 +0200

Changed in xournal:
status: New → Fix Released
Revision history for this message
Andrew Frank (frank-geoinfo) wrote :

the problem still exists in hardy - but only that the dependencies of xournal are not including xpdfreader (?)

the error message is the same - missing pdftoppm
but using synaptic it is possible to fix the problem.
therefore my guess: the dependencies in xournal are not complete.

thank you
andrew

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

Duplicates of this bug

Other bug subscribers

Remote bug watches

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