Bug 73201 - FILEOPEN: erratic DOCX page count and repagination / No warning on export of non-existing pages to PDF
Summary: FILEOPEN: erratic DOCX page count and repagination / No warning on export of ...
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.1.4.2 release
Hardware: Other All
: medium normal
Assignee: Not Assigned
URL: http://download-codeplex.sec.s-msft.c...
Whiteboard: Confirmed:4.2.0.1:OSX target:24.2.0 t...
Keywords: filter:docx, filter:pdf
Depends on:
Blocks: DOCX-Page
  Show dependency treegraph
 
Reported: 2014-01-01 09:52 UTC by ostap.radkovskyy
Modified: 2023-08-08 08:18 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
The test file in question, uploaded here in case it changes in its original location (464.77 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2017-03-11 13:00 UTC, Johnny_M
Details
Sample for image (107.03 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2020-04-07 09:28 UTC, Timur
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ostap.radkovskyy 2014-01-01 09:52:05 UTC
Steps to reproduce:

1. Open this doc http://download-codeplex.sec.s-msft.com/Download/Release?ProjectName=1code&DownloadId=357518&FileTime=129768839169630000&Build=20841
2. Go to Export as PDF, enter pages, say, 117-last page of the doc
3. Try to open exported pdf after the process is complete - I can always see just one page (should be as much pages as counted in between page start-page finish).
Comment 1 retired 2014-01-01 12:36:00 UTC
Confirmed:4.2.0.1:OSX

I entered 117-145 in "pages" in the export pdf dialogue. Result is a pdf with a single page. > NEW.
Comment 2 Helge 2015-02-20 04:28:16 UTC
The demonstration document has only 97 pages. When I enter 117-145 I get page last page of the document exported. I don't see any problematic behavior
Comment 3 Buovjaga 2015-02-25 11:47:58 UTC
There is something wrong with LibreOffice counting the pages.
On opening in Win, I get 105 pages. Scrolling to the bottom it changes to 89.
On opening in Ubuntu, I get 105 pages. Scrolling to the bottom and back starts bringing it down.. finally settling at 93 pages.

When exporting a range of pages to PDF after managing to reduce the count, I could get it to be consistent on Windows: 80-89 pages gave a PDF of 10 pages.

Might be a duplicate, but let's set to NEW for now.

I've got this similar .odt page count experience: https://bugs.documentfoundation.org/show_bug.cgi?id=69861#c8

Win 7 Pro 64-bit, LibO Version: 4.4.0.3
Build ID: de093506bcdc5fafd9023ee680b8c60e3e0645d7
Locale: fi_FI

Ubuntu 14.10 64-bit 
Version: 4.4.0.3
Build ID: 40m0(Build:3)
Locale: en_US
Comment 4 tommy27 2016-04-16 07:24:09 UTC Comment hidden (obsolete)
Comment 5 Telesto 2016-12-07 08:23:57 UTC
Still reproducible with: 
Version: 5.4.0.0.alpha0+
Build ID: 2bad9f1cd8da0cd3d8ff33e875eaf10c1fd9d0bf
CPU Threads: 4; OS Version: Mac OS X 10.12.1; UI Render: default; 
TinderBox: MacOSX-x86_64@49-TDF, Branch:master, Time: 2016-11-29_01:04:44
Locale: nl-NL (nl_NL.UTF-8); Calc: group
Comment 6 Johnny_M 2017-03-11 13:00:12 UTC
Created attachment 131812 [details]
The test file in question, uploaded here in case it changes in its original location

(In reply to Helge from comment #2)
> The demonstration document has only 97 pages. When I enter 117-145 I get
> page last page of the document exported. I don't see any problematic behavior

That's what I get, too. (Although it's 95 pages in total in my case - see below for the probable reason.) The somewhat problematic behavior I see is that there is no warning if one tries to export non-existing (i.e. beyond the page count) pages to PDF. The last existing page is quietly exported in such a case.

Version: 5.2.5.1
Build ID: 1:5.2.5~rc1-0ubuntu1~yakkety0
CPU Threads: 4; OS Version: Linux 4.8; UI Render: default; VCL: gtk3; 
Locale: en-US (en_US.UTF-8); Calc: group


(In reply to Buovjaga from comment #3)
> There is something wrong with LibreOffice counting the pages.
> On opening in Win, I get 105 pages. Scrolling to the bottom it changes to 89.
> On opening in Ubuntu, I get 105 pages. Scrolling to the bottom and back
> starts bringing it down.. finally settling at 93 pages.
> 
> When exporting a range of pages to PDF after managing to reduce the count, I
> could get it to be consistent on Windows: 80-89 pages gave a PDF of 10 pages.
> 
> Might be a duplicate, but let's set to NEW for now.
> 
> I've got this similar .odt page count experience:
> https://bugs.documentfoundation.org/show_bug.cgi?id=69861#c8
> 
> Win 7 Pro 64-bit, LibO Version: 4.4.0.3
> Build ID: de093506bcdc5fafd9023ee680b8c60e3e0645d7
> Locale: fi_FI
> 
> Ubuntu 14.10 64-bit 
> Version: 4.4.0.3
> Build ID: 40m0(Build:3)
> Locale: en_US

That is probably either bug 102224 (note that the doc uses the C-fonts) or bug 102226 - depending on OS and the character kerning setting in the document; it should be fixed with bug 105454. Or it's one of the several "different page count due to moved object, etc. in DOCX when opened in LO" bugs.
Comment 7 QA Administrators 2018-06-26 02:42:33 UTC Comment hidden (obsolete, spam)
Comment 8 Timur 2020-04-07 08:51:27 UTC
This is fine with at least 7.0+, LO opens 90 pages (also if DOCX resaved in MSO), which is rather good.
MSO opens 88 pages, but after a pretty long time, increasing slowly from 7.

There are a few repagination bugs closed as WFM. Reverse bibisect would be slow but could show where this was improved. 

As for minor difference 88-90, that's another issue, not a single one, so maybe never to be resolved. There are already bugs with difference with Microsoft fonts. Here it's also about image, heading flow etc, that I'll check separately.
Comment 9 Timur 2020-04-07 09:13:14 UTC
Heading 1.1 Principles & Themes looks wrong in LO, but OK if resaved in MSO, both with and without compatibility option. So no need to report that. 

Image from p.29 doesn't fit in LO, so on p.30, both for compatibility and resaved DOCX. I'll report separately, although maybe known.
Comment 10 Timur 2020-04-07 09:28:42 UTC
Created attachment 159387 [details]
Sample for image

Image issue is probably bug 89699.
Comment 11 Commit Notification 2023-08-04 09:29:12 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/c545a0729e89ee2e8f14534b77422cc9eb4eb7cf

sw floattable, crashtesting: fix PDF export of tdf73201-1.docx

It will be available in 24.2.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:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 12 Commit Notification 2023-08-08 08:18:40 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "libreoffice-7-6":

https://git.libreoffice.org/core/commit/35a8e22495a4cf756e650e8e4d840da1e8df80af

sw floattable, crashtesting: fix PDF export of tdf73201-1.docx

It will be available in 7.6.1.

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:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.