Bug 119880

Summary: Exported PDF containing PDF 1.5 images cannot be opened with Adobe Reader (other readers work)
Product: LibreOffice Reporter: Yang Yang <wdscxsj>
Component: Printing and PDF exportAssignee: Not Assigned <libreoffice-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: aron.budea, bagustris, buzea.bogdan, raal, vmiklos, xiscofauli
Priority: medium Keywords: bibisected, bisected, filter:pdf
Version: 6.1.0.3 release   
Hardware: All   
OS: All   
See Also: https://bugs.documentfoundation.org/show_bug.cgi?id=128379
Whiteboard: target:7.2.0
Crash report or crash signature: Regression By:
Bug Depends on:    
Bug Blocks: 143999    
Attachments: Test document
export-default.pdf
export-reference-xobjects.pdf
freezing when bibisecting

Description Yang Yang 2018-09-14 14:49:06 UTC
Description:
6.1.1 fails every time, while 6.0.6 works fine.

Steps to Reproduce:
1. Create a new document.
2. Insert a PDF 1.5 image.
3a. Directly export the document to PDF, named export-default.pdf.
3b. Export to PDF with "Use reference XObjects" enabled, named export-reference-xobjects.pdf.

Actual Results:
3a. export-default.pdf is corrupted. Adobe Reader fails to render it. Foxit Reader and SumatraPDF render a part, but the font information seems lost.
3b. export-reference-xobjects.pdf is a valid PDF, but the original PDF image is rasterized.

Expected Results:
Both files should be valid PDF and maintain the original vector effects: curves, text, fonts, etc.


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 6.1.1.2 (x64)
Build ID: 5d19a1bfa650b796764388cd8b33a5af1f5baa1b
CPU threads: 4; OS: Windows 10.0; UI render: default; 
Locale: zh-CN (zh_CN); Calc: CL
Comment 1 Yang Yang 2018-09-14 14:50:41 UTC
Created attachment 144865 [details]
Test document
Comment 2 Yang Yang 2018-09-14 14:51:22 UTC
Created attachment 144866 [details]
export-default.pdf
Comment 3 Yang Yang 2018-09-14 14:51:56 UTC
Created attachment 144867 [details]
export-reference-xobjects.pdf
Comment 4 raal 2018-09-14 18:29:31 UTC
3a - Confirm with Version: 6.2.0.0.alpha0+
Build ID: 433fce6571d4b9121374047324a7d2d2722ac3e4
CPU threads: 4; OS: Linux 4.4; UI render: default; VCL: gtk3; 
and pdf viewer in Firefox. Export is correct in 5.1, regression.

in cli "some font thing failed"
Comment 5 BogdanB 2018-09-15 18:27:14 UTC
Can NOT reproduce on:
Versiune: 6.0.3.2
Identificator construire: 1:6.0.3-0ubuntu1
Fire CPU: 4; OS: Linux 4.15; Redare UI: implicit; VCL: gtk3; 
Setări regionale: ro-RO (ro_RO.UTF-8); Calc: group threaded

Can reproduce on:
Version: 6.1.1.0.0+
Build ID: 5a56b72413d5f555c854e36d3bd2fd50ec21644c
CPU threads: 4; OS: Linux 4.15; UI render: GL; VCL: gtk2; 
TinderBox: Linux-rpm_deb-x86_64@70-TDF, Branch:libreoffice-6-1, Time: 2018-08-15_02:45:13
Locale: ro-RO (ro_RO.UTF-8); Calc: group threaded

Can reproduce on:
Version: 6.2.0.0.alpha0+
Build ID: 9a9b81c7212fa6a6762246593acf3f1950677a22
CPU threads: 4; OS: Linux 4.15; UI render: GL; VCL: gtk2; 
TinderBox: Linux-rpm_deb-x86_64@86-TDF, Branch:master, Time: 2018-09-08_00:00:43
Locale: ro-RO (ro_RO.UTF-8); Calc: threaded
Comment 6 BogdanB 2018-09-15 18:32:41 UTC
Created attachment 144902 [details]
freezing when bibisecting

I tried to bibisect with 6.1 but it is freezing when tring to export to PDF. See the image
Comment 7 Yang Yang 2018-09-16 03:55:40 UTC
@BogdanB Yes, 6.1 often freezes, and 6.1.1 doesn't. Perhaps my post on ask.libreoffice.org (https://ask.libreoffice.org/en/question/164916/pdf-exporting-of-writer-610-blurs-embedded-pdf-images/) can provide some clue.
Comment 8 Aron Budea 2020-02-02 08:08:00 UTC
3a:
Export starts freezing from the following commit. The issue is probably similar to bug 128379.

https://cgit.freedesktop.org/libreoffice/core/commit/?id=99ac4ee05b039166eedfe361fb985682fd92dd13
author		Khaled Hosny <khaledhosny@eglug.org>	2018-04-24 09:57:00 +0200
committer	Miklos Vajna <vmiklos@collabora.co.uk>	2018-04-27 15:41:42 +0200

"Change default PDF version to 1.5"

Freezing stopped with the following commit:
https://cgit.freedesktop.org/libreoffice/core/commit/?id=79e5f8a1f875c169759dc45d93d2b521ec9368f6
author		Caolán McNamara <caolanm@redhat.com>	2018-08-01 19:25:27 +0100
committer	Michael Stahl <Michael.Stahl@cib.de>	2018-08-03 11:11:37 +0200

"forcepoint#66 make sure we don't get stuck endlessly reparsing"
Comment 9 ⁨خالد حسني⁩ 2022-12-28 21:50:20 UTC
*** Bug 128379 has been marked as a duplicate of this bug. ***
Comment 10 ⁨خالد حسني⁩ 2022-12-28 22:18:59 UTC
I can not reproduce this or bug 128379. The attached PDF does not open indeed, but the ones I export open without an error.

I’m getting something different, though. The images in the exported PDF are very small, but this affects all readers and probably related to macOS hidpi handling.
Comment 11 Aron Budea 2022-12-31 20:09:44 UTC
This got fixed in two steps, via the following commits. After the first commit, the page is shown in Adobe Reader, with an error message that the font contains a bad /BBox. No error after the second commit:

https://cgit.freedesktop.org/libreoffice/core/commit/?id=6ab5c9e99dccec23a80eb1980dc46986b8c5abca
author		Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>	2020-11-05 23:37:30 +0100
committer	Tomaž Vajngerl <quikee@gmail.com>	2020-11-11 22:06:44 +0100

"pdf: use a common call to parse a object"

https://cgit.freedesktop.org/libreoffice/core/commit/?id=50bc6db73466121744848e04f21c934c3b596897
author		Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>	2020-11-09 19:16:27 +0100
committer	Tomaž Vajngerl <quikee@gmail.com>	2020-11-23 00:49:51 +0100

"pdf: improve PDFObjectCopier, copy arrays/dicts recursively"