Bug 121725 - Export to PDF from DOCX gives wrong PDF file that doesn't open with error
Summary: Export to PDF from DOCX gives wrong PDF file that doesn't open with error
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Printing and PDF export (show other bugs)
Version:
(earliest affected)
6.3.0.0.alpha0+
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bibisected, bisected, filter:pdf, regression
: 121912 (view as bug list)
Depends on:
Blocks: PDF-Export
  Show dependency treegraph
 
Reported: 2018-11-26 19:08 UTC by Roman Kuznetsov
Modified: 2018-12-06 13:35 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
DOCX from 121615 (64.84 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2018-11-26 19:08 UTC, Roman Kuznetsov
Details
PDF from 6.3 alpha 0 (71.95 KB, application/pdf)
2018-11-26 19:09 UTC, Roman Kuznetsov
Details
121615 libreoffice bug logo (48.46 KB, application/pdf)
2018-12-05 18:18 UTC, Xavier Van Wijmeersch
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Roman Kuznetsov 2018-11-26 19:08:31 UTC
Description:
Export to PDF from DOCX gives wrong PDF file that doesn't open with error
In PDF-XChange Viewer I get an error:

===== Open Error Info =====
Code: 0x82140002
Description: Error [PDF Structure 40]: Invalid file format

Version: 6.3.0.0.alpha0+
Build ID: 878c36f829fd88cda95ca218a2cf03003f50e53d
CPU threads: 4; OS: Windows 10.0; UI render: GL; VCL: win; 
TinderBox: Win-x86@42, Branch:master, Time: 2018-11-24_22:47:49
Locale: ru-RU (ru_RU); UI-Language: en-US
Calc: threaded

it's a regression, because PDF from LO 6.2 beta 1 opens fine

Steps to Reproduce:
1. Open file DOCX from attach
2. Export it to PDF uses icon on Standard toolbar
3. Try open PDF in PDF viewer

Actual Results:
PDF file is broken and doesn't open

Expected Results:
PDF file opens fine


Reproducible: Always


User Profile Reset: No



Additional Info:
Comment 1 Roman Kuznetsov 2018-11-26 19:08:58 UTC
Created attachment 147056 [details]
DOCX from 121615
Comment 2 Roman Kuznetsov 2018-11-26 19:09:41 UTC
Created attachment 147057 [details]
PDF from 6.3 alpha 0
Comment 3 Xavier Van Wijmeersch 2018-11-26 19:55:14 UTC
following your steps i have no problem with opening the pdf file under linux (okular and xpdf)

Version: 6.3.0.0.alpha0+
Build ID: e1cbd518118a5f2889213e5725e0e0a3c133de5d
CPU threads: 8; OS: Linux 4.19; UI render: default; VCL: kde4; 
Locale: nl-BE (en_US.UTF-8); UI-Language: en-US
Calc: threaded

maybe only windows???
Comment 4 Roman Kuznetsov 2018-11-27 06:06:59 UTC
in another build on another machine

Version: 6.3.0.0.alpha0+
Build ID: f21d2b48bd68424a96aa6cd5572e368208378291
CPU threads: 4; OS: Windows 6.1; UI render: default; VCL: win; 
TinderBox: Win-x86@42, Branch:master, Time: 2018-11-27_00:26:54
Locale: ru-RU (ru_RU); UI-Language: en-US
Calc: threaded

I have the same problem
Comment 5 Mike Kaganski 2018-11-27 07:01:15 UTC
Reproducible with Version: 6.3.0.0.alpha0+ (x64)
Build ID: 851c80fdf6fb3509b53c6301dd0721be58c18719
CPU threads: 12; OS: Windows 10.0; UI render: GL; VCL: win; 
Locale: ru-RU (ru_RU); UI-Language: en-US
Calc: CL

Trying to open the PDF generated from attachment 147056 [details] with Adobe Acrobat Reader DC 2019.008.20081, I get this:

> Adobe Acrobat Reader could not open '121615 LibreOffice-Bug-Logo.pdf' because
> it is either not a supported file type or because the file has been damaged
> (for example, it was sent as an email attachment and wasn't correctly decoded).
Comment 6 Roman Kuznetsov 2018-11-27 07:33:35 UTC
(In reply to Xavier Van Wijmeersch from comment #3)
> following your steps i have no problem with opening the pdf file under linux
> (okular and xpdf)
> 
> Version: 6.3.0.0.alpha0+
> Build ID: e1cbd518118a5f2889213e5725e0e0a3c133de5d
> CPU threads: 8; OS: Linux 4.19; UI render: default; VCL: kde4; 
> Locale: nl-BE (en_US.UTF-8); UI-Language: en-US
> Calc: threaded
> 
> maybe only windows???

Could you please attach your PDF to this bug? May be Okular and xpdf just ignore some problems in PDF files.
Comment 7 raal 2018-11-28 11:45:24 UTC
This seems to have begun at the below commit.
Adding Cc: to Ilhan Yesil; Could you possibly take a look at this one? Thanks
 9491a45452b076bb70fae62866ab162658db7ac5 is the first bad commit
commit 9491a45452b076bb70fae62866ab162658db7ac5
Author: Norbert Thiebaud <nthiebaud@gmail.com>
Date:   Tue Nov 20 13:53:22 2018 -0800

    source 02a5cbb9814dc224114dfbf3bc0b6c53658450c9

    source 02a5cbb9814dc224114dfbf3bc0b6c53658450c9

author	Ilhan Yesil <ilhanyesil@gmx.de>	2018-11-19 14:50:25 +0100
committer	Thorsten Behrens <Thorsten.Behrens@CIB.de>	2018-11-20 22:43:46 +0100
commit 02a5cbb9814dc224114dfbf3bc0b6c53658450c9 (patch)
tree 493bc99f007688d7580ccd074b067a281f08d9a3
parent 8848881e25e75387a7ac26503c7da3787dd25b80 (diff)
tdf#121497 "Save As": File Format Type unchanged in Windows
Added checks for filter title, so filter titles are Windows
conform.
Comment 8 Mike Kaganski 2018-12-05 08:02:22 UTC
*** Bug 121912 has been marked as a duplicate of this bug. ***
Comment 9 Xavier Van Wijmeersch 2018-12-05 18:18:05 UTC
Created attachment 147307 [details]
121615 libreoffice bug logo

This is the pdf file you requested for (comment6)

Best regards
Comment 10 Xavier Van Wijmeersch 2018-12-05 18:23:01 UTC
info used libreoffice

Version: 6.3.0.0.alpha0+
Build ID: 834c7c2698443332a347374db10e17d7862d6e4f
CPU threads: 8; OS: Linux 4.19; UI render: default; VCL: kde4; 
Locale: nl-BE (en_US.UTF-8); UI-Language: en-US
Calc: threaded

Version: 6.3.0.0.alpha0+
Build ID: b15b1a2a90fa4c239ff8a6a33e73ff50ea422abf
CPU threads: 8; OS: Linux 4.19; UI render: default; VCL: kde4; 
TinderBox: Linux-rpm_deb-x86_64@86-TDF, Branch:master, Time: 2018-11-28_06:21:05
Locale: nl-BE (en_US.UTF-8); UI-Language: en-US
Calc: threaded
Comment 11 Mike Kaganski 2018-12-05 18:39:57 UTC
(In reply to Xavier Van Wijmeersch from comment #9)

Thanks.
The problem is identified (see comment 7), and is indeed Windows-specific, related to the mentioned commit breaking the filter list in Windows Save As dialog. This makes LibreOffice to not recognize the selected filter, and fall back to the ODF. Thus on Windows, when one chooses to save a PDF, actually a normal ODF is saved, with PDF extension.

Such ODF is the attachment 147057 [details], and that's why it cannot be open in PDF readers.

The problem is currently being worked on in bug 121569 (see https://gerrit.libreoffice.org/63715). If it would not make it into 6.2, I suppose it would be simply reverted there, and continue being fixed in master branch.