Bug 436301

Summary: Support non standard Libreoffice Embedded files
Product: [Applications] okular Reporter: Peter Maiwald <peter.maiwald>
Component: generalAssignee: Okular developers <okular-devel>
Status: RESOLVED NOT A BUG    
Severity: wishlist CC: aacid, nate, oliver.sander, yurchor
Priority: NOR    
Version: 20.12.3   
Target Milestone: ---   
Platform: Manjaro   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Hybrid PDF with Libreoffice Draw
Screenshot of different readers show no attachments in the test file

Description Peter Maiwald 2021-04-28 10:55:15 UTC
SUMMARY
Embedded Libreoffice files are not shown as embedded files in the File menu.

STEPS TO REPRODUCE
1. Create a hybrid pdf with Libreoffice (Draw).
2. Open this file in okular.
3. Click on File menu and see that embedded files is grayed out.

OBSERVED RESULT


EXPECTED RESULT


SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: manjaro 64bit
(available in About System)
KDE Plasma Version: KDE Plasma 5.21.4
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 Oliver Sander 2021-04-28 12:14:42 UTC
Please attach such a file.
Comment 2 Albert Astals Cid 2021-04-28 20:36:34 UTC
What Oliver said :)
Comment 3 Peter Maiwald 2021-05-02 14:25:25 UTC
Created attachment 138087 [details]
Hybrid PDF with Libreoffice Draw

Sample Hybrid Pdf
Comment 4 Albert Astals Cid 2021-05-02 17:56:34 UTC
As far as I can see there's no attachment in that file.

What makes you think there is one?
Comment 5 Peter Maiwald 2021-05-02 23:47:16 UTC
(In reply to Albert Astals Cid from comment #4)
> As far as I can see there's no attachment in that file.
> 
> What makes you think there is one?

Open it in Libreoffice Draw. There is the pdf and the Libreoffice Draw in this File. But nobody can see this in Okular.
Comment 6 Yuri Chornoivan 2021-05-03 06:26:45 UTC
Created attachment 138108 [details]
Screenshot of different readers show no attachments in the test file

Adobe Reader, mupdf, Foxit Reader, and PDF-XChange Editor show no attachments either.
Comment 7 thb 2021-05-03 06:45:08 UTC
LibreOffice embeds src documents in a rather nonstandard way (then again, at the time the feature was added there was no standard way TTBOMK) - it gets added as AdditionalStreams dict in the document trailer.

FWIW, code is here: https://git.libreoffice.org/core/+/refs/heads/master/vcl/source/gdi/pdfwriter_impl.cxx#5402

(due to the established install base, hard to change how this is written; then again _adding_ PDF-A/3 conformant SOURCE embedding should prolly be done at some stage. See also https://bugs.documentfoundation.org/show_bug.cgi?id=66580)

This is FYI, I have no view on whether supporting a non-standard (albeit perhaps moderately wide-spread) custom embedding is in scope for Okular.
Comment 8 Peter Maiwald 2021-05-03 09:14:10 UTC
How can I see that I can edit this pdf file and with which program?
Comment 9 Yuri Chornoivan 2021-05-03 09:33:29 UTC
(In reply to Peter Maiwald from comment #8)
> How can I see that I can edit this pdf file and with which program?

As it follows from Comment 7, you can safely edit the main layer in LO Draw or Inkscape and you can safely edit annotations in Okular, Evince, Foxit Reader, or Adobe Reader. They are in the different streams of data.
Comment 10 Albert Astals Cid 2021-05-03 16:33:49 UTC
@thb I don't understand what you mean with "no standard way of adding documents", pdf has had document embedding since PDF 1.3 (Embedded file streams).

Personally I don't see the point on supporting non standard files, we already have too much of the standard we don't support because of lack of time to implement it, spending time implementing support for non standard files seems wrong to me.
Comment 11 Peter Maiwald 2021-05-03 19:10:32 UTC
I have created a bug report at Libreoffice:
https://bugs.documentfoundation.org/show_bug.cgi?id=142051
Comment 12 Oliver Sander 2021-05-07 08:19:45 UTC
Reading

  https://bugs.documentfoundation.org/show_bug.cgi?id=66580

(an old duplicate of your bug report), it seems quite clear that the LO folks are unhappy about their nonstandard way of embedding odt files into pdf files, and would rather see that changed.  It is therefore extremely unlikely that Okular will ever implement support for the current LibreOffice way of embedding documents.  Any developer effort is much better spent making LibreOffice standard-compatible.

I will therefore close this bug report.  Thanks for your interest in Okular!