Bug 332136 - Enable saving .okular archives as pdf, preserving annotations
Summary: Enable saving .okular archives as pdf, preserving annotations
Status: RESOLVED FIXED
Alias: None
Product: okular
Classification: Applications
Component: general (show other bugs)
Version: 0.16.5
Platform: Ubuntu Linux
: NOR wishlist
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-14 14:08 UTC by haavard
Modified: 2017-11-26 23:01 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description haavard 2014-03-14 14:08:12 UTC
When one exports a PDF as an Okular document archive, it should be possible to just as easily convert it back to a PDF file, while preserving annotations. 

In other words, someone please make a GUI option to save .okular archives as .pdf with embedded annotations.

Current workaround: 
1: Extract the .okular archive with archive manager (original pdf + 2 XML files)
2: Make an annotation in the newly unpacked pdf. This creates an xml file containing the annotation data in ~/.kde/share/apps/okular/docdata/
3: Replace the file created in step 2 with the 'metadata.xml' file from step 1.

Reproducible: Always

Steps to Reproduce:
1. Export PDF with annotations as File -> Export as -> Document Archive 
2. Open .okular file. 
3. Try saving it as a PDF
Comment 1 Albert Astals Cid 2014-03-15 15:24:02 UTC
Just use the save action in the file menu?
Comment 2 Albert Astals Cid 2014-03-15 15:24:31 UTC
Doesn't "Save As" work?
Comment 3 haavard 2014-03-17 09:59:48 UTC
No, "Save as" only saves to whichever format the file has. It doesn't convert to or from .okular. To save a PDF as an okular archive, you need to "Export as --> Document archive". There should be an option to do it the other way around as well, i.e. "Export as --> Portable document format" or something.
Comment 4 Albert Astals Cid 2014-03-17 20:53:34 UTC
Ah so what you want is opening a file you have previously saved as .okular and save it together with the changes you made in a .okular to a .pdf? Why did you save it originally as .okular then?
Comment 5 haavard 2014-03-18 08:45:22 UTC
Because the pdf was encrypted, and I couldn't save changes to it. When I was done with the annotation, I wanted to save it as a PDF again. 

I've decrypted the PDF now and worked around it as described, but it was a tedious process.
Comment 6 Albert Astals Cid 2014-03-18 19:24:53 UTC
Well, it's a pretty corner-case use-case, but sure, if someone comes up with a patch we can review it.
Comment 7 null 2017-11-26 23:01:34 UTC
As of KDE Applications 17.12, saving an Okular document archive originating from a PDF back to a PDF while preserving annotations will be supported. Not only that, it also works actually (just tested it :).

As for saving arbitrary formats to PDF, this can be achieved to some degree via printing in theory. However, preserving annotations probably won't work in that case. If anyone is actually interested in this, a new bug should be opened.