Bug 118597 - pasting images into LibreOffice Writer is resulting in documents that won't print / render inconsistently with differing number of pages
Summary: pasting images into LibreOffice Writer is resulting in documents that won't p...
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.0.5.2 release
Hardware: All Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-07-06 22:42 UTC by Michael Pardee
Modified: 2018-10-18 13:56 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Example document (1.82 MB, application/vnd.oasis.opendocument.text)
2018-07-23 14:03 UTC, Buovjaga
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Pardee 2018-07-06 22:42:02 UTC
Description:
Several of our users have been complaining that print jobs from LibreOffice haven't been printing properly: they either cause a printing error or not all of the pages come out of the printer.  Here is an example document consisting of images that were cut and pasted from a google image search in chrome:
http://s2.groovix.net/tmp/flowers-7-pages.odt

When you try to print it, it works on some printers, but when printing to some printers like the HP 553 color printer you get cups filter errors.  If you export it to PDF and then print it with another app like evince you only get some of the pages.  If you print pages 1-4 and pages 5-6 separately the problem does not occur!

I can't be 100% sure that this isn't just a problem with cups or specifically ghostscript, but that document exhibits some very odd behavior even while working with it in Writer.  As I tried to delete some images from it to figure out which pages were causing the problem suddenly it would shrink down by several pages.  Try deleting the first 2 images on page 1 , suddenly the document goes down to 5 pages with a bunch of pictures overlapping - is that normal?  Is the picture overlapping/formatting causing the printing problem?

My best guess is that LibreOffice Writer is generating print data that isn't quite right.


Steps to Reproduce:
1. using Ubuntu 16.04 + libreoffice writer 6.0.5.2 open this document http://s2.groovix.net/tmp/flowers-7-pages.odt
2. set up a new printer, change the driver to HP M553 Postscript [en]  ( recommended ) ( or grab the ppd from here: http://s2.groovix.net/tmp/color_debug.ppd )  - note that you don't really have to have an HP M553 printer, the error will occur while processing the job.  
3. print the document, you'll get an error and if you have your cups debug level set to debug or debug2 you'll see "GPL Ghostscript 9.18: Unrecoverable error, exit code 1" in /var/log/cups/error_log

Actual Results:
CUPS gives an error and the document is stuck in the queue as "processing" 

I narrowed the cups error down to this command:
gs -q -dNOPAUSE -dBATCH -dSAFER -sDEVICE=ps2write -sOUTPUTFILE=%stdout -dLanguageLevel=3 -r600 -dCompressFonts=false -dNoT3CCITT -dNOINTERPOLATE -c \'save pop\' -f /tmp/00bca5b47d0c1 

GPL Ghostscript 9.18: Unrecoverable error, exit code 1

Error: /undefined in 'save
Operand stack:

Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--
Dictionary stack:
   --dict:1203/1684(ro)(G)--   --dict:0/20(G)--   --dict:78/200(L)--
Current allocation mode is local
%!PS-Adobe-3.0
%%BoundingBox: 0 0 612 792
%%HiResBoundingBox: 0 0 612.00 792.00
%%Creator: GPL Ghostscript 918 (ps2write)
%%LanguageLevel: 2
%%CreationDate: D:20180706164351-05'00'
%%Pages: 1
%%EndComments
%%BeginProlog
/DSC_OPDFREAD true def
... I can post the entire file if desired ...



Expected Results:
Document should print normally - haven't had an issue printing from any other problem or with most libreoffice documents.  


Reproducible: Always


User Profile Reset: Yes



Additional Info:
This was just recently reported after moving to LibreOffice 6 , but using the document in question the problem still occurs in LibreOffice 5.   

currently using Build ID 1:6.0.5~rc2-0ubuntu0.16.04.1~lo1
Comment 1 Michael Pardee 2018-07-07 19:31:13 UTC
Here's some more odd behavior this document exhibits:

I opened flowers-7-pages.odt with LibreOffice Writer 6.0.3-0ubuntu1 in Xubuntu 18.04 , and when it first opens it says "Page 1 of 7" in the lower lefthand corner, then after a second it says "Page 1 of 5" , and the document renders as only taking up 5 pages.  Printing works but it is only 5 pages.

Then I installed LibreOffice 6.1 from debs downloaded from LibreOffice's site and they installed into /opt .  With 6.1 the document stayed at 7 pages.

Then I did a completely fresh Xubuntu 18.04 install, and now it switches from 7 pages to 5 pages while loading - even with version 6.1  .

I have deleted .config/libreoffice on both installs.  What difference in the operating system would cause LibreOffice to display a document as a different number of pages?

Here is a screenshot of the 7 page vs. 5 page rendering difference between two Xubuntu 18.04 installs using the exact same version of LibreOffice 6.1.0.1: http://s2.groovix.net/tmp/7-pages-5-pages.png
Comment 2 Buovjaga 2018-07-23 14:03:13 UTC
Created attachment 143718 [details]
Example document
Comment 3 Buovjaga 2018-07-23 14:20:44 UTC
I don't see any pagination problems with 6.0.5 or master. Tried with gtk2 VCL backend. I also tried on Windows.
No problem with PDF export either. Always 7 pages.

I attempted the printer thing, but realised I'm no good with manually fiddling with ppd stuff and gave up.

Arch Linux 64-bit
Version: 6.2.0.0.alpha0+
Build ID: b9d18daf5b23155a9b4dfcdd5d1f23ed53bc3849
CPU threads: 8; OS: Linux 4.17; UI render: default; VCL: gtk3; 
Locale: fi-FI (fi_FI.UTF-8); Calc: group threaded
Built on July 22nd 2018

Arch Linux 64-bit
Version: 6.0.5.2
Build ID: 6.0.5-1
CPU threads: 8; OS: Linux 4.17; UI render: default; VCL: kde4; 
Locale: fi-FI (fi_FI.UTF-8); Calc: group
Comment 4 Michael Pardee 2018-07-23 20:02:42 UTC
Thanks Buovjaga, I didn't think it would render differently on different OSes.   I tried it on Windows 10 and manjaro and it renders as 7 pages. I also tried redhat 28 and debian 9.5 and they also render as 7 pages with several different libreoffice versions.

But on Ubuntu 18.04 and Linux Mint ( based on Ubuntu ) which include 6.0.3.2 by default, the document renders as 5 pages.  If you install 6.0.5.2 on Ubuntu from the libreoffice fresh ppa it still renders as 5 pages.   However if you install 6.0.5.2 from the libreoffice site debs into /opt then it renders as 7 pages and uses VCL: gtk2.   I thought the gtk3 vs. gtk2 difference might be significant so I uninstalled libreoffice-gtk3 and installed libreoffice-gtk so both use VCL: gtk2 and the version from the Ubuntu repository still renders as 5 pages.  Also 6.0.3.2 using VCL: gtk3 renders properly in redhat but not ubuntu, so I don't think it is a gtk2 vs. gtk3 difference. Also,  6.0.6.1 from theubuntu  prereleases ppa also renders as 5 pages.

I guess I should file a bug against the libreoffice package in Ubuntu, but can anyone here give me any ideas on what difference could be causing this or how to debug it further?
Comment 5 Buovjaga 2018-07-24 08:07:53 UTC
(In reply to Michael Pardee from comment #4)
> I guess I should file a bug against the libreoffice package in Ubuntu, but
> can anyone here give me any ideas on what difference could be causing this
> or how to debug it further?

Unfortunately I am out of ideas. You even reset the profile. I assume you don't have OpenGL enabled as it rarely works on Linux (Tools - Options - LibreOffice - View - Use OpenGL for all rendering).
Comment 6 Xisco Faulí 2018-10-18 11:45:42 UTC
Hello Michael Pardee,
Could you please try to reproduce it with the latest version of LibreOffice
from https://www.libreoffice.org/download/libreoffice-fresh/ ?
I have set the bug's status to 'NEEDINFO'. Please change it back to
'UNCONFIRMED' if the bug is still present in the latest version.
Comment 7 Michael Pardee 2018-10-18 13:53:59 UTC
The problem appears to be fixed.  That document renders as 7 pages with the latest debs directly from libreoffice.org, as well as the default Ubuntu 18.04 repositories and 16.04 with the fresh PPA repositories.  

Thank you.
Comment 8 Xisco Faulí 2018-10-18 13:56:42 UTC
Thanks for retesting with the latest version.
Setting to RESOLVED WORKSFORME as the commit fixing this issue hasn't been identified.