Bug Hunting Session
Bug 46904 - [PRINTING] Invalid PDF generated when creating single job collation
Summary: [PRINTING] Invalid PDF generated when creating single job collation
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
3.5.0 release
Hardware: x86-64 (AMD64) Linux (All)
: high major
Assignee: David Tardon
URL:
Whiteboard: bibisected35
Keywords: regression
: 47131 47361 48389 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-03-02 09:31 UTC by pezcurrel
Modified: 2012-08-27 09:44 UTC (History)
10 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description pezcurrel 2012-03-02 09:31:38 UTC
Libreoffice Writer doesn't print multiple copies of any document.
Same bug as ...
https://bugs.freedesktop.org/show_bug.cgi?id=33693
... but on linux (Ubuntu 10.04), and with different Libreoffice version.
Comment 1 irishbandit 2012-03-03 11:07:51 UTC
Printing multiple copies of a document with libreoffice 3.5 installed from ppa does not work. https://launchpad.net/~libreoffice/+archive/ppa
LibreOffice 3.5.0
Build ID: 350m1(Build:13) does not print multiple copies

The version downloaded from www.libreoffice.org prints multiple copies fine for me.
LibreOffice 3.5.0rc3 
Build ID: 7e68ba2-a744ebf-1f241b7-c506db1-7d53735 does print multiple copies

Ubuntu 11.10 x86_64
3.3.0-030300rc4-generic
Comment 2 bordfeldt 2012-03-03 11:34:20 UTC
(In reply to comment #1)
> Printing multiple copies of a document with libreoffice 3.5 installed from ppa
> does not work. https://launchpad.net/~libreoffice/+archive/ppa
> LibreOffice 3.5.0
> Build ID: 350m1(Build:13) does not print multiple copies

I have exact the same problem on my Ubuntu 10.04 64bit.
Comment 3 irishbandit 2012-03-04 13:32:43 UTC
Additionally from the other bug post https://bugs.freedesktop.org/show_bug.cgi?id=33693#c4,
the issue is the same with version of LibreOffice 3.5.0rc3 
Build ID: 7e68ba2-a744ebf-1f241b7-c506db1-7d53735 
although it  does print multiple copies it sends each copy as a separate print job and that behavior crashes some printers. I don't know if that can be fixed or not.
Comment 4 vitriol 2012-03-09 01:34:05 UTC
*** Bug 47131 has been marked as a duplicate of this bug. ***
Comment 5 vitriol 2012-03-15 08:21:11 UTC
*** Bug 47361 has been marked as a duplicate of this bug. ***
Comment 6 bordfeldt 2012-03-22 10:49:44 UTC
After updating my LO 3.5.0 to 3.5.1 today via ppa the problem stays the same.
Comment 7 irishbandit 2012-03-25 21:05:25 UTC
Could some one with this issue try the suggestion from:
http://permalink.gmane.org/gmane.comp.documentfoundation.libreoffice.user/1631

I think this goes back to 2005 & OOo 1.x. When printing, select the
'Options' tab and then select "Create single print jobs for collated
output"   

And see if it works?

I can install from ppa some time this week and see if the workaround works.
Comment 8 Paolo Benvenuto 2012-03-25 23:21:24 UTC
On LO 3.5.1 it seems that multiple copies aren't printed if booklet mode is set, while they are printed if it's not set.
Comment 9 bordfeldt 2012-03-26 11:38:54 UTC
On my LibreOffice 3.5.1 (on Ubuntu 10.04 64bit, installed over ppa) both workarounds don't work.
To select "Create single print jobs for collated output" has no effect. And if the booklet mode is not set multiple copies of a document arent't printed, too.
Comment 10 Björn Michaelsen 2012-03-30 15:15:09 UTC
Is LibreOffice 3.5.1 really the first version in which this does not work?

Also: As this is claimed to be Ubuntu specific in Comment 1 (https://bugs.freedesktop.org/show_bug.cgi?id=46904#c1) -- if so, is there a launchpad bug for this?

Adding regression keyword as this is supposed to be working in 3.3.
Comment 11 Paolo Benvenuto 2012-03-30 22:31:35 UTC
it's in 3.5.0 too
Comment 12 Björn Michaelsen 2012-03-31 04:06:44 UTC
Does this persist if you set PSLevel=2 in /etc/libreoffice/psprint.conf ?
Comment 13 Björn Michaelsen 2012-03-31 04:17:50 UTC
Setting PSLevel=2 forces PostScript generation which seems to be ok, while PDF generation is broken. Printing to File shows the same issue.
Comment 14 Björn Michaelsen 2012-03-31 04:27:42 UTC
Steps to reproduce:
1) Have PSLevel=0 (default) in /etc/libreoffice/psprint.conf
2) Create a new document, type "foo"
3) Print, with the following settings:
  - 2 copies
  - print to file
  - do not select "Create single print jobs for each collated output"
4) save to a file foo.pdf
5) open file with evince: it will only have one page and complain similar to:
   Error: May not be a PDF file (continuing anyway)
   Error (2434): Illegal character '{'
   Error: PDF file is damaged - attempting to reconstruct xref table...
   Error: Couldn't find trailer dictionary
   Error: Couldn't read xref table
Comment 15 Björn Michaelsen 2012-03-31 04:59:01 UTC
Just looking for the first time we generated invalid pdf output:
# bad: [4c30602f43475389f81b1d981ce8ee9a3410b9d9] source-hash-85c6244b85b29c1d2bb9d89b62e9512dd65378b5
# good: [65fd30f5cb4cdd37995a33420ed8273c0a29bf00] source-hash-d6cde02dbce8c28c6af836e2dc1120f8a6ef9932
git bisect start 'latest' 'oldest'
# good: [2faf4bc12ab490370d2196dedbc8091f9b09d0a5] source-hash-418a35f4861e863feb39eec73f4a39a87fbcb1f3
git bisect good 2faf4bc12ab490370d2196dedbc8091f9b09d0a5
# good: [b6fca7e58854bc617c5fc9a75d1c1720b0d7e1a4] source-hash-ce60138d339a5eb2a174a5d27063249acf2cac42
git bisect good b6fca7e58854bc617c5fc9a75d1c1720b0d7e1a4
# good: [216e447cb0a457985f20d4db481fa9c73b0bb775] source-hash-55c5ea43a59e505297fb6fa20b77aaa28f7c67bc
git bisect good 216e447cb0a457985f20d4db481fa9c73b0bb775
# good: [569ab0259fc5fcc3190d9ae9c44e1e28570bc8bd] source-hash-817bf1d41bb07aeb3ed7649d25c2b44ee4acb1fe
git bisect good 569ab0259fc5fcc3190d9ae9c44e1e28570bc8bd
# good: [cfad378ec3c0de9f19525a2eef4cef9bc056e3f6] source-hash-10f977981d2cfb6ba0ccd0185ccb12e212010bc2
git bisect good cfad378ec3c0de9f19525a2eef4cef9bc056e3f6
# good: [a4c1bd2fe1dccc0fa192cc5cf9ebd2967c6a9920] source-hash-558b5ea32a99654dcb63526f107726f7aec4747f
git bisect good a4c1bd2fe1dccc0fa192cc5cf9ebd2967c6a9920

So we started to generate invalid pdf between:

 git log 558b5ea32a99654dcb63526f107726f7aec4747f..85c6244b85b29c1d2bb9d89b62e9512dd65378b5

which incidentally has a lot of dtardon tweaking on printing, thus CC'ing.
Comment 16 David Tardon 2012-04-01 21:19:07 UTC
I think I fixed that last week with fa87093686614d75d63664722de103e47f91c7db .
Comment 17 Björn Michaelsen 2012-04-04 05:21:41 UTC
Verified, with the patch applied valid PDF gets generated.
Comment 18 Björn Michaelsen 2012-04-04 06:43:51 UTC
cherry-picked to libreoffice-3-5:
http://cgit.freedesktop.org/libreoffice/core/commit/?h=libreoffice-3-5&id=d347e443e2c847d50f45ac810c5f78de3b892e3a

for 3.5.3
Comment 19 vitriol 2012-04-06 09:41:54 UTC
*** Bug 48389 has been marked as a duplicate of this bug. ***
Comment 20 bordfeldt 2012-04-13 05:21:06 UTC
In 3.5.2.2 LO Writer can print multiple copies of a document now again.
Comment 21 Peter Hardman 2012-05-01 02:24:50 UTC
Still can't print mutiple copies with 3.5.2.2 Build ID: 350m1(Build:202) on ArchLinux x86_64.

This is to an HP Laserjet 1100. With or without Collate checked.

If. in the print dialog, I go to Properties->Device and change 'Printer Language Type' from the default PDF to 'Postscript (level from Driver)' multiple copies print OK.

There seems to be no way to change this permanantly. /etc/libreoffice/psprint.conf has PSLevel=0. Changing this to anything else makes no difference.
Comment 22 Caolán McNamara 2012-05-01 03:29:21 UTC
please don't reopen bugs unless you absolutely know that the problem you're experiencing is the same as the original. File a new one please and try the procedure in comment #14 to see if the output pdf is invalid, and that's your problem, or if its something else which has the same symptoms
Comment 23 Peter Hardman 2012-05-01 03:47:43 UTC
(In reply to comment #22)
> please don't reopen bugs unless you absolutely know that the problem you're
> experiencing is the same as the original. File a new one please and try the
> procedure in comment #14 to see if the output pdf is invalid, and that's your
> problem, or if its something else which has the same symptoms

OK. I missed the change of this bug from 'can't print multile copies' to 'PDF printing is broken'.

I will open a new bug.
Comment 24 Jakob Unterwurzacher 2012-08-27 09:24:07 UTC
That new bug https://bugs.freedesktop.org/show_bug.cgi?id=49332
Comment 25 Björn Michaelsen 2012-08-27 09:44:44 UTC
even if this would be the same bug, it is claimed in comment 18 that the fix has been backported to 3.5.3 -- before reopening, please at least check with a version 3.5.3 or later.