Bug 160860 - the last page is not printed
Summary: the last page is not printed
Status: RESOLVED FIXED
Alias: None
Product: okular
Classification: Applications
Component: general (show other bugs)
Version: 0.6.3
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
: 165738 173411 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-04-15 12:16 UTC by Vito Bellini
Modified: 2008-10-24 10:57 UTC (History)
8 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vito Bellini 2008-04-15 12:16:43 UTC
Version:           0.6.3 (using 4.0.3 (KDE 4.0.3), Gentoo)
Compiler:          i686-pc-linux-gnu-gcc
OS:                Linux (i686) release 2.6.22-gentoo-r8

Let be n the number of pages for a generic pdf document.
I'm trying to print all pages of document, okular will print only pages from 1 to n-1.
I've tried only with okular + pdf files. OpenOffice under KDE4 works properly.
Comment 1 Albert Astals Cid 2008-04-16 19:41:22 UTC
Could you please attach the document that causes this problem? Or happens always?
Comment 2 Vito Bellini 2008-04-17 12:00:46 UTC
Albert Astals Cid ha scritto:
[bugs.kde.org quoted mail]

It happens always; in my case with any PDF documents. I'haven't tried 
with other document types supprted by Okular.
Comment 3 Pino Toscano 2008-04-28 00:01:29 UTC
The strange thing is that the generated PostScript from the PDF document is correct (= has the right number of pages).

John, any idea?
Comment 4 Matthew Truch 2008-05-29 17:40:48 UTC
I also have this problem with okular printing pdf's in Fedora 9 (KDE 4.0.4).  Any way I can help you guys debug this?  
Comment 5 John Layt 2008-05-29 20:47:20 UTC
Sorry, had computer issues so haven't been able to look at this up to now.  Will address this weekend when I fix some other printing stuff.  Possibly an off by one problem when passing the print range to lpr, but I only do that if it isn't 'All Pages' selected in the dialog.  Unfortunately, I can't confirm the bug just yet as I'm running KDE4.1 beta 1 and Qt4.4 on OpenSuse 11.0 beta 3and there's something wrong in the printing stack :-)  I'll try with a live CD or virtual machine on the weekend.

Some things to try to help track this down:
* Just to confirm, this applies to all PDF documents regardless of number of pages, so a 2 page document only prints the first page?  
* And 1 page documents are OK?  
* Can you tell me know what versions of Qt and Cups you are running?  
* Do you know if you have the Cups version of lpr installed?
* Can you run Okular from the command line and tell me what debug lines you get output after you print?
* Are you doing this by selecting 'All Pages' in the dialog or 'From x To y'?  Can you try both options to see what happens?  
* Could you try the same with a multi-page ps, dvi, or djvu file to see what happens (should have same problem if fault lies in FilePrinter)?  
* Could you try with a multipage comicbook or tiff file to see what happens (shouldn't have the problem)?  

That should be enough to get started :-)
Comment 6 John Layt 2008-06-03 23:45:02 UTC
I have reproduced this under KDE 4.1svn, Qt4.4.0, OpenSuse 11.0 rc1.  A 6 page document misses the last page, a 3 page document only prints the first page.

Switching off auto-delete of ps file, I get the following debug output:

Executing "lpr" with arguments ("-P", "Photosmart_C5200", "-#1", "-J", "Hadrians Wall 2008", "-o", "media=A4", "-o", "portrait", "-o", "sides=one-sided", "-o", "outputorder=normal", "-o", "Collate=False", "/tmp/odysseus-kde4/kde-odysseus/okularWr4818.ps")

The lpr command does not contain any page range options, and checking the ps file shows all pages are there.  Executing this lpr command directly from the command line gets all pages printed.  All very perplexing, perhaps something in KProcess?
Comment 7 Marcelo Sales 2008-06-13 02:43:10 UTC
Confirmed here in Fedora 9 with any PDF document I try to print. Also, if you try to print a selection of pages from a bigger document, say pages 1-5 of a 10 pages document, it will also not print the last page of the selection. In this example, okular prints pages 1-4 only.
Comment 8 bve 2008-06-20 11:03:57 UTC
Same for me on debian testing with okular from experimental (v. 0.6.80 on kde 4.0.82).

It happens as far as I can tell with all kind of PDFs. 
I if print a one-page document it doesn't print anything. 
libqtcore4 is 4.4.0-2 
cupsys is 1.3.7-5
I don't know if I have cups version of lpr installed. How do I check?

on the command-line, I get:

okular
okular(7905) KMimeTypeFactory::parseMagic: Now parsing  "/usr/share/mime/magic"
QObject::connect: Cannot connect (null)::rowsRemoved(const QModelIndex&, int, int) to KFilePlacesView::adaptItemSize()
Object::connect: No such signal QPrintDialog::currentIndexChanged(int)
Object::connect: No such signal QPrintDialog::currentIndexChanged(int)

It happens with print all pages as well as selecting a page-range.

A two-page ps is printed correctly, opening a dvi okular crashes. I don't have multipage TIFF-files to test.

Greetings,
Ben
Comment 9 Pino Toscano 2008-07-04 19:49:37 UTC
*** Bug 165738 has been marked as a duplicate of this bug. ***
Comment 10 Martin Schnieders 2008-07-21 10:52:17 UTC
For me, I have also problems printing PDFs with Okular. The last page is missing at all and every PDF I tried.

System:
Kde 4.1 RC 1 on (K)Ubuntu 8.04
Comment 11 John Layt 2008-07-21 19:15:03 UTC
I'm struggling to find a cause for this.

* Printing a PDF file misses out pages.
* Printing a PS file doesn't miss pages
* PDF and PS printing use the same FilePrinter code
* FilePrinter does not use Qt to generate or submit the print job
* PDF printing first converts the PDF to a PS file before printing
* Browsing and/or Printing the resulting PS using okular doesn't miss pages
* Printing the resulting PS using the generated lpr command from the command line doesn't miss pages
* The generated lpr command does not specify the page range
* The generated lpr command is the same for both PDF and PS
* It currently affects at least >= 4.0.4 and 4.1 (with Qt4.4)
* It didn't affect 4.0.0 when first released (with Qt4.3)
* FilePrinter was not modified during 4.0.x before the problem started
* Printing from adobe or kpdf doesn't miss pages

All of which in theory rules out any issues with Cups, Qt, FilePrinter, KProcess, or the libpoppler PDF to PS conversion.  Which doesn't leave a lot else :-)

Perhaps a clean install of an old distro followed by progressive upgrades of the different components would be revealing as to which one is the culprit.  The Qt 4.3 to 4.4 upgrade could be suspect, however we don't use it for the print job submission, but it would be good to rule out.
Comment 12 John Layt 2008-07-23 13:39:16 UTC
Could I ask for all future me-too's/votes on this bug to report the following:

* KDE version
* Qt version
* Poppler version
* Cups version

In particular I'm interested if you DON'T have the problem, or if you have the problem with the KDE4.0 and Qt4.3 combination.  

If your combination is already reported then please don't duplicate.
Comment 13 Marc Ponschab 2008-07-23 14:49:50 UTC
"me-too" on up-to-date FC9:

* KDE version:     4.0.5 (kdelibs-4.0.5-5.fc9/kdegraphics-4.0.5-1.fc9)
* Qt version:      4.3.5 (qt-4.3.5-2.fc9)
* Poppler version: 0.8.1 (poppler-0.8.1-1.fc9)
* Cups version:    1.3.7 (cups-1.3.7-8.fc9)

To boxes (i386 and x86_64), on both same issue: 
okular (0.6.5) print only pages from 1 to n-1 
Comment 14 Rex Dieter 2008-07-23 17:48:59 UTC
Confirmed here too:
* KDE version:     4.0.99 (kdegraphics-4.0.99-1.fc9.x86_64)
* Qt version:      4.4.0 (qt-4.4.0-16.fc9.x86_64, current qt-copy, including patch for bug #162793)
* Poppler version: 0.8.1 (poppler-qt4-0.8.1-1.fc9.x86_64)
* Cups version:    1.3.7 (cups-1.3.7-8.fc9.x86_64)

pdfs print 1 - (n-1).  though one of my test cases, a 3 page sample2e.pdf (from tex), would print only page 1.
Comment 15 Ryan Ren 2008-07-30 04:43:00 UTC
Okular 0.7
KDE 4.1.0
poppler 0.8.4
cups 1.3.8

Arch Linux

this problem happens for every pdf file, the last page never been printed. When choose to print the last page only, nothing is printed.
Comment 16 Aaron Hagopian 2008-08-06 22:18:00 UTC
well to add to the mystery I really needed that last page printed so I told it to print the pages in reverse.

For a 9 page PDF I tried to print pages 8-9 in reverse, nothing comes out.  7-9 I received page 8 and 9 printed on the same page (overalayed) and page 7 came out normal. Still haven't gotten my page 9 to print.

Also maybe I need to file a separate bug but on the properties for my printer from okular it keeps showing paper size A4 even though my global regional settings for KDE is US Letter and the PDF properties from Okular also shows the document page size as 8.5x11.  I can use other KDE apps like Konqueror and go to print and properties for my printer shows Letter, only Okular wants to switch it to A4.

Okular 0.7
KDE 4.1.0
poppler 0.8.1
cups 1.3.7
Fedora 9
Comment 17 Valentin Longchamp 2008-08-08 12:57:57 UTC
Another me too here to confirm this bug. When I need the last page, printing only the last page of the document does not work either.

Okular 0.7
KDE 4.1.0
poppler 0.8.3
cups 1.3.7

Ubuntu 8.04.1
Comment 18 AE 2008-08-08 13:09:05 UTC
Perhaps it would help if anyone who posts a me-too would also _vote_ for this bug, to bring it to the attention of those higher up (if you haven't already done so, that is).
Comment 19 Pino Toscano 2008-08-08 13:29:36 UTC
> to bring it to the attention of those higher up

If you think we are blatantly ignoring bug reports, you are quite wrong.
If we would have a solution, it would be either posted here or in SVN.
The bug is being investigated, please no need for "me too" or "wake up developers".

Thanks.
Comment 20 AE 2008-08-08 13:42:36 UTC
> If you think we are blatantly ignoring bug reports, you are quite wrong.
I don't think so, and I am sorry if my post seemed to imply this. Indeed I am very grateful for the hard word you all are doing for our (the kde users) benefit.
Only that bug bites me fairly hard, and I for one would like to see it a bit higher on the 'most hated bugs' ladder, so that perhaps more people look into this thing, and someone has a bright idea on how to solve it. Perhphaps I'm wrong about this, but I have the impression that bug-voting is a bit of an under-used feature.
Comment 21 Pino Toscano 2008-08-10 15:59:50 UTC
> I for one would like to see it a bit higher on the 'most hated bugs' ladder, so that perhaps more people look into this thing

Your implication (more votes == more people looking into it) does not stand.
If there would be people with actually an idea about the problem, we would have asked them already.
Comment 22 Ferdinand Gassauer 2008-08-12 06:32:32 UTC
same problem in 
Version 4.1.1 (KDE 4.1.0 (4.1 >= 20080722)) "release 26.2"
libqt4-4.4.1-6.1


eventually a qt4 problem like
http://bugs.kde.org/show_bug.cgi?id=162793
Comment 23 Pino Toscano 2008-08-12 11:28:19 UTC
@anybody:
It would be nice if you could avoid pointless "me too" that add nothing to this bug report. If you have *something* new to add to this, feel free to add it, otherwise please avoid adding unuseful noise to this bug report, thanks.

@Ferdinand Gassauer (comment #22):
> eventually a qt4 problem like
> http://bugs.kde.org/show_bug.cgi?id=162793

Eventually, no.
Comment 24 Pino Toscano 2008-08-20 16:14:42 UTC
Fixed; the fix will be available in KDE 4.1.1.

Fix for trunk (4.2): http://websvn.kde.org/?view=rev&revision=849949
Fix for 4.1: http://websvn.kde.org/?view=rev&revision=849951
Comment 25 Pavel Suk 2008-09-29 16:17:57 UTC
Gentoo
KDE 4.0.5
app-text/poppler-bindings-0.9.2
app-text/poppler-0.9.2
net-print/cups-1.3.8-r1
Printer: Konica-Minolta Magicolor 2530DL
Driver: foo2zjs from: http://foo2lava.rkkda.com/
http://foo2zjs.rkkda.com/foo2zjs.tar.gz

USE="3dnow a52 aac acpi -aim alsa amd64 apache2 apm -arts bidi bluetooth bzip2 -cairo cdda cdio cdr cgi clamav crypt css ctype cups dbus djvu dts dvd dvdr dvdread -evo examplesexif fastcgi ffmpeg firefox flac flash freetype ftp gd gif gimp -gnome gnutls gpm -gps -gstreamer -gtk -gtk2 -gtkhtml hal htmlhandbook httpd -ibm icq -ieee1394 ipv6 irc jabber -jack java6 javascript jikes jingle -joystick jpeg jpeg2k kde -lirc  live matroska midi mime mp3 mpeg mplayer -msn -mssql mysql mysqli nsplugin nvidia ogg oggvorbis opengl pcre pdf php png -qt3 qt4 quicktime raw rss samba session slang sqlite sqlite3 srt ssl stream svg svga symlink theora threads tidy tiff truetype unicode usb vcd videos vim-syntax vlmvorbis wavpack -wifi X -xface xml2 xsl xulrunner xv -yahoo zip zlib"

---
Okular:
One page - Nothing printed
Two pages - Only one printed
3 - 2 pages printed
4 - 3 pages printed
No more tested

OO 2.4 works with no problems.
Comment 26 Pino Toscano 2008-09-29 16:25:30 UTC
@Pavel Suk (comment #25):
please do read comment #24. Your version does not contain the fix, KDE 4.1.1 (and above) does.
Comment 27 Brad Hards 2008-10-24 10:57:28 UTC
*** Bug 173411 has been marked as a duplicate of this bug. ***