Bug 103516 - Calc: Fit to range(s) weight/height: printing almost blank pages in LO, but not in Excel, when "Height in pages" value is "Automatic"
Summary: Calc: Fit to range(s) weight/height: printing almost blank pages in LO, but n...
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Printing and PDF export (show other bugs)
(earliest affected)
4.1 all versions
Hardware: All All
: medium normal
Assignee: Not Assigned
Whiteboard: target:6.4.0
Keywords: filter:xls, filter:xlsx
Depends on:
Blocks: XLSX
  Show dependency treegraph
Reported: 2016-10-26 09:34 UTC by Gabor Kelemen (allotropia)
Modified: 2019-09-18 10:33 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:
Regression By:

The problematic document (12.11 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2016-10-26 09:34 UTC, Gabor Kelemen (allotropia)
Page height settings as seen in Excel 2013 and LO 5.1.4 (46.37 KB, image/png)
2016-10-26 09:35 UTC, Gabor Kelemen (allotropia)
Page break view in Excel and Calc (91.06 KB, image/png)
2016-10-26 09:36 UTC, Gabor Kelemen (allotropia)
.xls sample (29.50 KB, application/vnd.ms-excel)
2016-10-26 15:04 UTC, Xisco Faulí

Note You need to log in before you can comment on or make changes to this bug.
Description Gabor Kelemen (allotropia) 2016-10-26 09:34:37 UTC
Created attachment 128280 [details]
The problematic document

Attached xlsx has page width defined as 1, page height defined as "Automatic".
Opening it in Calc causes the "Automatic" value converted to 1.

This in turn makes the table part on page 4 (after the last page break) to be printed to two pages with one row going to page 5.

In Excel 2013 the part on page 4 is printed to one page.
Comment 1 Gabor Kelemen (allotropia) 2016-10-26 09:35:40 UTC
Created attachment 128281 [details]
Page height settings as seen in Excel 2013 and LO 5.1.4

The same conversion happens in 5.3 master too.
Comment 2 Gabor Kelemen (allotropia) 2016-10-26 09:36:22 UTC
Created attachment 128282 [details]
Page break view in Excel and Calc
Comment 3 Xisco Faulí 2016-10-26 14:57:30 UTC
Confirmed in

Build ID: 8974b0fafb18f9dd3f2c0e175a3255b80e4c249e
CPU Threads: 4; OS Version: Linux 4.2; UI Render: default; 
Locale: ca-ES (ca_ES.UTF-8); Calc: group


Version (Build ID: efca6f15609322f62a35619619a6d5fe5c9bd5a)
Comment 4 Xisco Faulí 2016-10-26 15:04:26 UTC
Created attachment 128289 [details]
.xls sample

Same result in .XLS
Comment 5 Julien Nabet 2016-10-26 20:27:18 UTC
When I uncompressed first attachment and format it, I noticed lines like this:
<row r="1" spans="1:9" ht="101.25" customHeight="1" x14ac:dyDescent="0.25">
in xl/worksheets/sheet1.xml
Comment 6 QA Administrators 2017-10-27 08:49:21 UTC Comment hidden (obsolete)
Comment 7 eisa01 2018-06-16 18:39:42 UTC
This is still present

Build ID: b292a27698e85fd9d60c03613c3b0c67835c4dc1
CPU threads: 2; OS: Mac OS X 10.12.6; UI render: default; 
TinderBox: MacOSX-x86_64@49-TDF, Branch:master, Time: 2018-06-06_23:25:55
Locale: en-US (en_US.UTF-8); Calc: group threaded
Comment 8 László Németh 2019-09-18 10:23:17 UTC
tdf#103516 Calc: fit columns to page similarly to Excel

With the page setting "Fit print range(s) to width/height",
"Width in pages" > 0, and no "Height in pages" selected,
apply slightly smaller zoom (~98% of the selected zoom),
when this adjustment results printing fewer pages,
ie. no more pages printed, than MSO.

Note: a very annoying problem was that Calc printed almost
blank extra pages (containing only one or a few table rows)
from documents that Excel printed "correctly".
Comment 9 Commit Notification 2019-09-18 10:23:49 UTC
László Németh committed a patch related to this issue.
It has been pushed to "master":


tdf#103516 Calc: fit columns to page similarly to Excel

It will be available in 6.4.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:

Affected users are encouraged to test the fix and report feedback.
Comment 10 László Németh 2019-09-18 10:31:02 UTC
Note: This bug is about an interoperability problem (printing almost blank pages only in LO, but not in Excel), not its suspected cause, the (already solved) UI problem.