After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 556216 - Evince 2.24 only shows the last page of this postscript file
Evince 2.24 only shows the last page of this postscript file
Status: RESOLVED NOTGNOME
Product: evince
Classification: Core
Component: PS
2.24.x
Other All
: Normal major
: ---
Assigned To: Evince Maintainers
Evince Maintainers
Depends on:
Blocks:
 
 
Reported: 2008-10-14 03:36 UTC by Daniel Holbert
Modified: 2008-10-17 18:08 UTC
See Also:
GNOME target: ---
GNOME version: 2.23/2.24


Attachments
testcase 1 (102.10 KB, application/postscript)
2008-10-14 03:39 UTC, Daniel Holbert
Details
source HTML for testcase 1 (2.53 KB, text/html)
2008-10-14 03:43 UTC, Daniel Holbert
Details

Description Daniel Holbert 2008-10-14 03:36:55 UTC
Please describe the problem:
Evince 2.24 only seems to recognize the last page of a number of postscript files I've tested.  


Steps to reproduce:
1. Open testcase 1 (attached) using Evince 2.24


Actual results:
I see the last page of the document (lines 164-180), with "[ 1 ] of 1" shown in the page selector on the top toolbar.  (Basically, it's like Evine thinks there's just one page -- the final page.)

Expected results:
I should see the first page of the document (lines 1-40), with "[ 1 ] of 5" shown in the page selector on the top toolbar.

Does this happen every time?
Yes.

Other information:
The testcase is quite simple -- it's generated using a plain HTML document that has "font-family: helvetica", which I then print to a Postscript file in Mozilla Firefox 3.0.x (I've tried the 3.1 nightly builds as well, and it's the same).

I initially filed a bug in Mozilla's bug tracker about this, but I closed it as invalid after realizing it was a bug in Evince.  For reference, the Mozilla bug is: https://bugzilla.mozilla.org/show_bug.cgi?id=459778

I get the above-described buggy behavior on a system running up-to-date Ubuntu 8.10 beta, with evince version 2.24.0-0ubuntu2  (as listed in "apt-cache show evince")

However, I get expected behavior (5 pages shown) on another system running Ubuntu 8.04, with evince version 2.22.1.1-0ubuntu1 (as listed in "apt-cache show evince")
Comment 1 Daniel Holbert 2008-10-14 03:39:16 UTC
Created attachment 120548 [details]
testcase 1

This is the postscript file, of which Evince 2.24 only shows the last page.
Comment 2 Daniel Holbert 2008-10-14 03:43:10 UTC
Created attachment 120549 [details]
source HTML for testcase 1

Here's the source HTML for the testcase, copied from https://bugzilla.mozilla.org/attachment.cgi?id=342993

To generate a postscript file like the one I just attached, you can simply load this HTML file in Firefox 3.0.x / 3.1pre, do Ctrl-P to print, and choose "print to file".
Comment 3 Carlos Garcia Campos 2008-10-14 08:14:34 UTC
What libspectre version do you have installed? It's not reproducible for me with libspectre 0.2.1
Comment 4 Daniel Holbert 2008-10-14 18:36:50 UTC
(In reply to comment #3)
> What libspectre version do you have installed? It's not reproducible for me
> with libspectre 0.2.1

Ah -- I have libspectre version 0.2.0, on *both* machines.

Here are the specific versions, from "apt-cache show libspectre1":

  (Working) Ubuntu 8.04 machine:  0.2.0.ds-1build1
  (Buggy)   Ubuntu 8.10 machine:  0.2.0.ds-1build3

I suppose it's possible (but unlikely?) that there was a bug introduced between Ubuntu's 'build1' and 'build3'.  Or maybe Evince 2.24 depends on features only available in libspectre 0.2.1?

Also, I forgot to mention earlier -- my working Ubuntu 8.04 machine has Evince version "2.22.2-0ubuntu1"
Comment 5 Carlos Garcia Campos 2008-10-17 08:47:38 UTC
I confirm it's reproducible with libspectre 0.2.0 but not with 0.2.1. Thanks for reporting. 
Comment 6 Daniel Holbert 2008-10-17 17:07:47 UTC
(In reply to comment #5)
Carlos: You seem to be suggesting that this is just a bug in libspectre 0.2.0, but that hasn't yet been demonstrated to be true.

As I pointed out (but perhaps didn't emphasize enough) in comment 4, libspectre 0.2.0 is *fine* with Evince 2.22.2 (in Ubuntu 8.0.4).  It only has issues with the upgraded Evince 2.24 (in Ubuntu 8.10).

Hence, I don't think resolving as NOTGNOME is appropriate at this point.  Reopening.
Comment 7 Carlos Garcia Campos 2008-10-17 17:40:21 UTC
No, I'm sure it's a libspectre issue, I've checked it with the libspectre sources. 

$ git checkout 0.2.0
Note: moving to "0.2.0" which isn't a local branch
If you want to create a new branch from this checkout, you may do so
(now or later) by using -b with the checkout command again. Example:
  git checkout -b <new_branch_name>
HEAD is now at 14e516b... Update for release 0.2.0

$ ./autogen.sh && make
......
$ cd test
$ ./spectre-test /tmp/test.ps /tmp/spc/
Testing libspectre version: 0.2.0
process 8981: spectre_document_load: assertion `document != NULL' failed (spectre-document.c:57)
Rendering document
Rendering document at 2x
Document format: PS-Adobe-3.0
Postscript language level: 2
Encapsulated PostScript: No
Number of pages: 1
Title: (null)
Creator: cairo 1.7.6 (http://cairographics.org)
For: (null)
Creation date: Mon Oct 13 20:22:04 2008
Document Orientation: Portrait
Page 0
	Page label: (null)
	Page size: 612 x 792
	Page orientation: Portrait
Error getting page 0 by its label (null): page is invalid
Rendering page 0 slice 204, 264, 204, 264
Rendering page 0 in a4 page

Note that only one page has been rendered.

$ cd ..
$ git checkout master
Switched to branch "master"
$ ./autogen.sh && make
.....
$ cd test
$ ./spectre-test /tmp/test.ps /tmp/spc/
Testing libspectre version: 0.2.1
process 15343: spectre_document_load: assertion `document != NULL' failed (spectre-document.c:57)
Rendering document
Rendering document at 2x
Document format: PS-Adobe-3.0
Postscript language level: 2
Encapsulated PostScript: No
Number of pages: 5
Title: (null)
Creator: cairo 1.7.6 (http://cairographics.org)
For: (null)
Creation date: Mon Oct 13 20:22:04 2008
Document Orientation: Portrait
Page 0
	Page label: 1
	Page size: 612 x 792
	Page orientation: Portrait
Page 1
	Page label: 2
	Page size: 612 x 792
	Page orientation: Portrait
Page 2
	Page label: 3
	Page size: 612 x 792
	Page orientation: Portrait
Page 3
	Page label: 4
	Page size: 612 x 792
	Page orientation: Portrait
Page 4
	Page label: 5
	Page size: 612 x 792
	Page orientation: Portrait
Rendering page 0 slice 204, 264, 204, 264
Rendering page 0 in a4 page

Note that five pages have been rendered. If it worked for you with evince 2.22 is probably because it was compiled with the gs backend instead of the libspectre one. Hopefully, there will be new libspectre packages for ubuntu intrepid. 
Comment 8 Daniel Holbert 2008-10-17 18:08:54 UTC
(In reply to comment #7)
> If it worked for you with evince 2.22
> is probably because it was compiled with the gs backend instead of the
> libspectre one.

Ah, that makes sense -- thanks for the explanation!