Bug 336381 - Save bookmarks directly to PDF or a sibling bookmarks file
Summary: Save bookmarks directly to PDF or a sibling bookmarks file
Status: CONFIRMED
Alias: None
Product: okular
Classification: Applications
Component: general (show other bugs)
Version: 0.19.1
Platform: Ubuntu Linux
: NOR wishlist
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
: 457017 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-06-18 08:22 UTC by Giovanni Triboli
Modified: 2022-07-23 09:10 UTC (History)
4 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 Giovanni Triboli 2014-06-18 08:22:38 UTC
A really useful feature : copying the current bookmarks (inside a PDF) from a PC to another either saving them into the file itself, or saving them into its .okular archive (like you do with the notes) or saving them into a sibling file with the same PDF name in the same folder (with xml extension) and automatically applying bookmarks when Okular reopen the document if it finds the sibling file there.

Reproducible: Always
Comment 1 Albert Astals Cid 2014-06-18 22:51:21 UTC
Needs thinking on how, but it is indeed a good idea.

Of course the "we don't have much time" problem is always around so people working on this is more than welcome.
Comment 2 Giovanni Triboli 2014-06-19 14:28:47 UTC
Albert,
I've always developed for the Windows platform only
so I don't know how to help

I fear it could be difficult for me
but with a little help from you
I can't exclude some possibility
in the next weeks

Giovanni


Il 19/06/2014 00:51, Albert Astals Cid ha scritto:
> https://bugs.kde.org/show_bug.cgi?id=336381
>
> Albert Astals Cid <aacid@kde.org> changed:
>
>             What    |Removed                     |Added
> ----------------------------------------------------------------------------
>               Status|UNCONFIRMED                 |CONFIRMED
>                   CC|                            |aacid@kde.org
>       Ever confirmed|0                           |1
>
> --- Comment #1 from Albert Astals Cid <aacid@kde.org> ---
> Needs thinking on how, but it is indeed a good idea.
>
> Of course the "we don't have much time" problem is always around so people
> working on this is more than welcome.
>
Comment 3 Albert Astals Cid 2014-06-19 20:04:53 UTC
Well start by compiling okular http://okular.kde.org/download.php Then we can think on what needs to be done to make this work properly.
Comment 4 Giovanni Triboli 2014-07-07 10:28:38 UTC
Albert,
I've gited the sources and succesfully built Okular 0.19.60 from his sources.

Now how to continue ?

On the "Getting started" page they suggest to use :
Qt Creator
KDevelop 4
Eclipse 
I don't know any of them.
Which one do you recommend ?

And later,
is there a project file I have to open to start browsing the sources ?

And finally, which source files (precisely) do I need to study
in order to apply the updates for introducing the bookmarks into a pdf ?

bye, Giovanni
Comment 5 Albert Astals Cid 2014-07-09 23:24:03 UTC
(In reply to comment #4)
> Albert,
> I've gited the sources and succesfully built Okular 0.19.60 from his sources.
> 
> Now how to continue ?
> 
> On the "Getting started" page they suggest to use :
> Qt Creator
> KDevelop 4
> Eclipse 
> I don't know any of them.
> Which one do you recommend ?

I'm more a user of kate, use the one you feel more confortable with.
 
> And later,
> is there a project file I have to open to start browsing the sources ?

No, just open the cpp files :)

> And finally, which source files (precisely) do I need to study
> in order to apply the updates for introducing the bookmarks into a pdf ?

Do you want me to do all the work ;-) Use grep, it's the prime tool for a programmer, grep for bookmark and it'll give you some files you want to have a look.
Comment 6 Giovanni Triboli 2014-07-10 15:51:24 UTC
Thank you, Albert, for your reply

meanwhile I've installed qtcreator and kdevelop and I've given a look to sources
In order to browse the code I need friendly tools
I think that when I'll be succeeding in debugging the code I'll start developing something useful
(but next week I'll be on vacation)

bye for now. Giovanni
Comment 7 Giovanni Triboli 2014-07-26 15:45:44 UTC
Albert, coming back home
I started the git process again to get up to date sources.
When trying to follow the recommended instruction here :
https://techbase.kde.org/Development/Tutorials/Building_An_Existing_Application
and running this command :
cmake -DCMAKE_INSTALL_PREFIX=$KDE_DEVELOPMENT_PATH -DCMAKE_BUILD_TYPE=debugfull ../../src/okular
this time I get this error :
In file included from /usr/include/qt5/QtCore/QtGlobal:1:0,
                 from /home/giovanni/devel/build/okular/CMakeTmp/check_qt_application.cpp:1:
/usr/include/qt5/QtCore/qglobal.h:1008:4: error: #error "You must build your code with position independent code if Qt was built with -reduce-relocations. " "Compile your code with -fPIC or -fPIE."
 #  error "You must build your code with position independent code if Qt was built with -reduce-relocations. "\

I really can't deal with this. Any hint from you ?

I don't know what's different on my pc since 20 days ago.
I fear that by the time I solve this you will be on the right way to complete the bookmark feature I requested

I'm now a happy Ubuntu user but switching as a developer is more difficult.

bye
Giovanni
Comment 8 Albert Astals Cid 2014-07-26 22:16:06 UTC
You don't have qt4 installed or if you have qt5 is taking over your qt4. Use qtchooser magic so that qt4 is your default qt when building okular
Comment 9 Giovanni Triboli 2014-07-28 15:07:23 UTC
Yes Albert,
you were right

now make command compile again successfully

but I've stumbled again
when I add a simple KMessageBox::information()
to see if okular stops where I want it to
nothing happens

I see that the executable isn't updated 
neither the shared library lib/okularpart.so
as make process states
(I have two instances in my system)

I think I can't improvise
Working this way is unprofitable
I lack some fundamentals informations
about the whole process
in addition to the Qt and Kde source library

As a coding teacher I think I should take a step by step course
before I could help you and your valuable project
You need a skilled assistant

I'm sorry
Bye for now
Giovanni
Comment 10 Albert Astals Cid 2014-07-28 21:50:24 UTC
See the last part of http://okular.kde.org/download.php, you basically need to install okular for it to work (you can do it in your home, no need to overwrite the system one)
Comment 11 null 2017-11-26 22:57:14 UTC
Saving bookmarks to Okular document archives is tracked in Bug 330961. Let's make this bug about saving bookmarks natively to the PDF.

Testing Adobe Reader and Foxit Reader, both have a single/combined panel for bookmarks and TOC entries (Okular has separated "Bookmarks" and "Content" panels, but also supports other file formats). Adding a "bookmark" in those programs will show up as a new "Content" entry in Okular.

Okular now supports storing annotations directly to PDF and PDF is probably the most important file format for Okular's user base by far. In addition, epub documents are likely to be read from start to finish, while tech spec PDFs tend to get quite long without being read linearly and custom bookmarking is most useful in that case. Therefore, I propose to optimize the user experience regarding (sharing) bookmarks with non-Okular users for the specific case of PDFs.

In addition to providing support for saving bookmarks to the PDF, this would need some thinking about workflow and UI, i.e. how not to confuse "Content" and "Bookmarks".

(Note that in macOS Preview "Bookmarks" seem to be separate too, but I could not investigate further how this is handled there.)
Comment 12 Nate Graham 2022-07-22 17:34:25 UTC
*** Bug 457017 has been marked as a duplicate of this bug. ***