Bug 127236 - When exporting a PDF with password, Objects are missing
Summary: When exporting a PDF with password, Objects are missing
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
5.4.0.3 release
Hardware: All All
: medium normal
Assignee: Miklos Vajna
URL:
Whiteboard: target:7.5.0 target:7.4.0.2
Keywords: bibisected, bisected, regression
Depends on:
Blocks: Password-Protected
  Show dependency treegraph
 
Reported: 2019-08-30 08:04 UTC by Colin Zimmermann
Modified: 2022-07-20 17:49 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
This is such a document with a not-working PDF-Scan inserted (415.56 KB, application/vnd.oasis.opendocument.text)
2019-08-30 11:56 UTC, Colin Zimmermann
Details
This is the result (155.92 KB, application/pdf)
2019-08-30 11:58 UTC, Colin Zimmermann
Details
tail of terminal output, bibisect-linux-64-5.4 (2.96 KB, text/plain)
2019-09-01 14:36 UTC, Terrence Enger
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Colin Zimmermann 2019-08-30 08:04:03 UTC
Description:
I inserted a few PDF-Scans into a Writer-Document, some with PDF-Version 1.4 and some with 1.3. When I export the Writer-Document to PDF, everything is fine. When I export it with a opening-password, those inserted PDF-Objects with Version 1.3 are missing.

Steps to Reproduce:
1. Insert PDFs with version 1.4 and 1.3 in the Writer-Document
2. Export it to PDF
3. Export it to PDF with opening-password

Actual Results:
The standart export is fine, but in the password-protected-export the Objects with PDF-Version 1.3 are missing

Expected Results:
Export everything correctly


Reproducible: Always


User Profile Reset: Yes



Additional Info:
Comment 1 Oliver Brinzing 2019-08-30 10:44:37 UTC
Thank you for reporting the bug. 
Please attach a sample document, as this makes it easier for us to verify the bug. 
(Please note that the attachment will be public, remove any sensitive information before attaching it. 
See https://wiki.documentfoundation.org/QA/FAQ#How_can_I_eliminate_confidential_data_from_a_sample_document.3F for help on how to do so.)

I have set the bug's status to 'NEEDINFO'. Please change it back to 'UNCONFIRMED' once the requested document is provided.
Comment 2 Colin Zimmermann 2019-08-30 11:56:30 UTC
Created attachment 153750 [details]
This is such a document with a not-working PDF-Scan inserted

When exporting to PDF with the button in the workbar (next to the print-button) everything is fine. But when exporting via "Datei"->"Exportieren als"->"als PDF exportieren" and setting a password for the opening of this PDF, the Scan is missing.
Comment 3 Colin Zimmermann 2019-08-30 11:58:09 UTC
Created attachment 153751 [details]
This is the result

This is the PDF with the password "password" where the scan is missing.
Comment 4 Colin Zimmermann 2019-08-30 11:59:42 UTC
Thanks for your help!
Comment 5 Oliver Brinzing 2019-08-30 14:16:12 UTC
reproducible with:

Version: 5.4.7.2 (x64)
Build-ID: c838ef25c16710f8838b1faec480ebba495259d0
CPU-Threads: 4; BS: Windows 6.19; UI-Render: Standard; 
Gebietsschema: de-DE (de_DE); Calc: single

but *not* reproducoble with:

Version: 4.4.7.2
Build-ID: f3153a8b245191196a4b6b9abd1d0da16eead600
Gebietsschema: de_DE
Comment 6 Terrence Enger 2019-09-01 14:36:20 UTC
Created attachment 153794 [details]
tail of terminal output, bibisect-linux-64-5.4

Working on debian-buseter in the bibisect-linux-64-5.4 repository, I see:

          commit    s-h       date
          --------  --------  -------------------
    good  b680c65d  aa8efc72  2017-02-23 15:35:33
    bad   0a833b40  78e25558  2017-02-23 15:36:18

The commit message is:

    commit 78e25558e86188314b9b72048b8ddca18697cb86
    Author: Miklos Vajna <vmiklos@collabora.co.uk>
    Date:   Thu Feb 23 16:35:15 2017 +0100

        tdf#106059 PDF export: create a reference XObject for JPG images with PDF data
    
        In case the bitmap is large enough, the bitmap for the PDF image is a
        JPG one, not a PNG one. Handle this case as well.
    
        Also stop compressing the PDF data: Adobe Acrobat gets confused when the
        second bugdoc is compressed and it doesn't provide much as most of a PDF
        is already compressed anyway.
    
        The rest is just refactoring to decouple the reference XObject code from
        PNG, to be able to use it for JPG as well.
    
        Change-Id: I5314a39b0f6d8c6493ecb36a0c588c895f5a70ee
Comment 7 John 2020-07-30 03:18:40 UTC
I'm seeing the same behavior importing PDFs into Draw, then exporting with password protection.  I tried it on both Linux and MacOS.  The PDF's I used were versions 1.5 and 1.6.

Versions of Libre Office:
Linux
Version: 6.4.5.1
Build ID: 1:6.4.5~rc1-2

Mac
Version: 6.3.6.2
Comment 8 Justin L 2021-03-23 09:22:40 UTC
repro 7.2+
Comment 9 Commit Notification 2022-07-20 10:55:47 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/7d56dae3375dc0180aa6d20983b3f5f962302588

tdf#127236 vcl: fix missing encryption of PDF images during export

It will be available in 7.5.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 10 Commit Notification 2022-07-20 17:49:01 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "libreoffice-7-4":

https://git.libreoffice.org/core/commit/3b74fc4419cdf066b4cbf770df84e2a1209ad072

tdf#127236 vcl: fix missing encryption of PDF images during export

It will be available in 7.4.0.2.

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.