Bug 55966 - Calc can't print, export to PDF, or print preview
Summary: Calc can't print, export to PDF, or print preview
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Printing and PDF export (show other bugs)
Version:
(earliest affected)
3.3.0 release
Hardware: x86 (IA32) All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-14 08:01 UTC by devrel
Modified: 2016-12-02 19:42 UTC (History)
7 users (show)

See Also:
Crash report or crash signature:


Attachments
LibreOffice Calc spreadsheet demonstrating problems with print/page preview/export PDF (43.93 KB, application/vnd.oasis.opendocument.spreadsheet)
2012-10-14 08:01 UTC, devrel
Details
Another example (from Impress) (165.49 KB, application/vnd.oasis.opendocument.presentation)
2013-08-05 14:41 UTC, Rubem
Details

Note You need to log in before you can comment on or make changes to this bug.
Description devrel 2012-10-14 08:01:36 UTC
Created attachment 68549 [details]
LibreOffice Calc spreadsheet demonstrating problems with print/page preview/export PDF

What is expected to happen: starting libreoffice with the attached spreadsheet from an xterm (libreoffice loprob.ods) will successfully print, page preview, and export to PDF.

What happens when you:

Export to PDF generates a popup error:
LibreOffice 3.6
Error saving the document loprob:
Write Error.
The file could not be written.

Page Preview comes up with a blank gray background rather than a preview.

Print nothing is printed, but the string "gtk printer" is shown on the invoking xterm console and a file is left behind in a temporary directory named something like "/tmp/luq5npeh.tmp/luq5npej.tmp". The .tmp file is an exact copy of the input file.

The behavior is highly sensitive to the contents of the spreadsheet. I have attached the offending document and it repeatably demonstrates the print/page preview problem described. However, if the final sheet ("Sheet10") of the document is deleted, the problem goes away and print/page preview function properly once again.

The problem was initially found by me in LO 3.5.4 on Ubuntu 12.04 and reported in launchpad at https://bugs.launchpad.net/ubuntu/+source/libreoffice/+bug/1066423 . The Ubuntu team then triaged it as reproducible on LO 3.6.2~rc2 under Ubuntu 12.10 as well as on Windows Vista 32x, LO 3.6.2.2 (Build ID: da8c1e6) , and requested I report it upstream, which I've now done.
Comment 1 Stephan Zietsman 2013-02-08 09:18:48 UTC
I almost filed a report on PDF export which would certainly be marked as a duplicate.  I also had trouble exporting to PDF from calc (the other components seem to be unaffected).

An error occurs when attempting to export a spreadsheet as PDF.

--==  Steps to reproduce  ==--

Create new spreadsheet (File -> New -> Spreadsheet)
Enter some text (E.g. 'Hello world')
Export as PDF (File -> export as PDF... -> Export -> Enter filename 'TestCalc' -> Save)

Expected behaviour:  TestCalc.pdf is created.
Actual behaviour:  Error saving the document Untitled1: Write Error.  The file could not be written.

--==  End of reproduction  ==--

I followed the steps above a few times with consitent errors.  However, when I closed and reopened LO, it exported correctly and did not give errors.  It appears to be inconsistent; not sure what caused it.  I did play around with exporting pdf with embedded OpenDocument (mainly in writer) before the error, if that helps.

-- 
Running LibreOffice 3.6.2.2 (as from repo)
Ubuntu 12.10 x64
About:  Version 3.6.2.2 (Build ID: 360m1(Build:2))
Comment 2 Rubem 2013-08-05 14:41:25 UTC
Created attachment 83667 [details]
Another example (from Impress)

With the attached file, selecting one or both pages and setting 'Range' to 'Selection' in the PDF Export page generates the error. Exporting all pages, or filling out the Pages field, does not seem to generate any errors.
Comment 3 Björn Michaelsen 2014-05-27 13:42:41 UTC
Checking the original bug report (attachment 68549 [details]), this already fails in the oldest version in bibisect (source-hash-d6cde02dbce8c28c6af836e2dc1120f8a6ef9932). If this ever worked, please name the last known version working correctly and mark this as a regression.

Also checked to still fail on LibreOffice 4.3.0~beta1 (source-hash-c15927f20d4727c3b8de68497b6949e72f9e6e9e).
Comment 4 Björn Michaelsen 2014-05-27 13:48:59 UTC
(for clarification: this means the bug was already present at least as early as e.g. in beta releases of 3.5.0)
Comment 5 Robinson Tryon (qubit) 2014-11-06 00:17:38 UTC
(In reply to devrel from comment #0)
> Created attachment 68549 [details]
> 
> What is expected to happen: starting libreoffice with the attached
> spreadsheet from an xterm (libreoffice loprob.ods) will successfully print,
> page preview, and export to PDF.
> 
> What happens when you:
> 
> Export to PDF generates a popup error:

CONFIRMED with LibreOffice 3.3.0 (OOO330m19 (Build:6) tag libreoffice-3.3.0.4) on Ubuntu 14.04.

(Got same error as OP)

> Page Preview comes up with a blank gray background rather than a preview.
>

Confirmed

Changing version -> 3.3.0(.4) release
Comment 6 QA Administrators 2016-01-17 20:05:00 UTC Comment hidden (obsolete)
Comment 7 devrel 2016-01-17 21:55:31 UTC
I still see this behavior with LibreOffice 4.3.3 as packaged for Debian Jessie x64.
I am unable to test with 5.0.4 as that's not supported for Jessie, and attempting
to install from jessie-backports is far too disruptive on other critical packages
on my system to risk for this purpose. Pity there isn't just a tarball I could
run the 5.0.4 binaries out of for testing.

I still consider this to be a major problem for me.
Comment 8 Jean-Baptiste Faure 2016-05-21 17:30:53 UTC
I do not understand where is the problem: the bugdoc does not have print range defined but for Sheet10 which is empty. Removing this print range allows to generate a pdf with a page for each sheet. If we keep the defined print range, LO generates a pdf with only one empty page for Sheet10. For me it works as expected.
Tested with master and LO 5.1.4.0.0+, both built at home under Ubuntu 16.04 x86-64.

Closing as worksforme. Please, feel free to reopen if you disagree
Comment 9 devrel 2016-05-22 03:45:41 UTC
(In reply to Jean-Baptiste Faure from comment #8)
> I do not understand where is the problem: the bugdoc does not have print
> range defined but for Sheet10 which is empty. Removing this print range
> allows to generate a pdf with a page for each sheet.

I'm not sure what the print range has to do with it. I have never
heard of the term until now and have never explicitly set a print range
on any document I've created (to my knowledge). So I don't understand why
some documents get a "print range" which is the useful set of cells I've
edited, and some don't get one at all, and why the Export As PDF
error dialog has nothing to do with the print range. ISTM if nothing
else, a meaningful error dialog could be generated. It doesn't sound as
if the actual problem has to do with "The file could not be written."
based on what you're describing here.
Comment 10 Jean-Baptiste Faure 2016-05-22 05:12:44 UTC
(In reply to devrel from comment #9)
> I'm not sure what the print range has to do with it. 

That define the area of a sheet of a spreadsheet to be printed. Please read the doc.

Before reopening, did you try with the current stable and fresh versions ?

Best regards. JBF
Comment 11 Ernst 2016-12-01 17:22:56 UTC
I'd like to report that this bug is also/anymore in LibreOffice V5.1.4.2 Build ID 1:5.1.4-0ubuntu1 using calc.(On Ubuntu 16.04 LTS, latest update)

Have a spreadsheet (mine has 25 Sheets) use file -> export as PDF ->
select "page" -> type Nr.-> Export -> type filename, press Enter.

Error message [Error saving the document name: WriteError.The file could not be written ] (Yes, I have the rights to write for the folder, the spreadsheet will be saved in the same folder) 

Sorry that I can't add the spreadsheet as it's content is confidental.
Comment 12 Buovjaga 2016-12-02 19:42:18 UTC
Ernst: check the print ranges. https://help.libreoffice.org/Calc/Edit_Print_Ranges

Closing again.

If someone wants to open a report about the error message, go ahead. This is already too long.