I was unable to find out how to open a pdf from the command line with the focus on a specified note (annotation). Is there currently a way to do that? And how does the command line need to look like? I would like to have something like: okular mypdf.pdf#note:1 or okular mypdf.pdf#note:"text of my note"
No, and to be honest i don't see the point, what you want that for? Moreover which is annotation 1? And what if two annotations have the same text?
The motivation for this question is to use okular in combination with docear http://www.docear.org/. Docear is capable of extracting references (chapters, figures, notes) from pdfs and one can jump (when using pdfXchange-viewer) directly to the chapter, figure, annotation. I would like to replace pdfxchange-viewer as it runs on wine.
And how does it reference chapter, figure, annotation?
Created attachment 79663 [details] pdf-file which is parsed by docear (see oder appended file) small sample file produced with latex and hyperref with an annotation made by okular and one by pdfxchangeviewer
Created attachment 79664 [details] Screen-shot of mindmap generated by docear with notes & sections Here is a screen-shot of what docear can extract from a simple pdf-file. The red arrows are links to the notes in the text (works for pdfxchange) for okular it jumps to the document (last opened location). The command to jump to the note (or section in pdfxchangeviewer is): PDFXCview.exe*/A*page=$PAGE&namedest=$TITLE*$FILE namedest=$TITLE give the location in the pdf-file
Unfortunately, I could not find any information on how docear is doing that.
It's a bit hard to implement something that we don't even know what we are supposed to implement.
I've just notified the lead Docear developer about this bug report.
Hello, I am Stefan of the Docear team. What we are currently doing is to read comments and bookmarks created in PDF files using the JPod library (http://sourceforge.net/projects/jpodlib/) and export them from the PDF files and attach them to nodes in mind maps. The nodes then contain information on - the link to the PDF file, - the page the annotation was extracted from, - and the annotation's object number. By clicking the link icon on a node, the PDF viewer will open up on the page containing the annotation. This is especially very useful for researchers, who are typically reading a lot of scientific documents every day and need to keep track of both the ideas and facts in general and the location where they have found them. Docear (http://www.docear.org) is an open source (GPL v2) project based on Java. It is available for MS Windows, MacOS and Linux or UNIX. I am using Debian (the unstable "sid" branch as my default operating system. Unfortunately I do not know a single PDF viewer for Linux which can do the following: - easily create notes and bookmarks in PDF files (like e.g. the Foxit reader, Adobe Acrobat or the PDF X-Change viewer available for MS Windows) and edit annotations created by these tools - store the PDF files preferably incrementally (i.e. keep the annotation's object numbers the same over all saved revisions of the PDF file --> this might not be needed for future versions of Docear) - automatically copy the contents of highlighted text into a "note annotation", so that Docear can read it and the user can modify it, e.g. by adding additional data or explanations. (This is a very useful feature in the PDF X-Change viewer) - and open a PDF file at the location of a specific annotation, e.g. by passing the annotation's object number to the PDF viewer (Okular can open a PDF file on a specific page, which is not optimal for our use case, but nevertheless very useful) Is there a way to implement these features into Okular? On Linux systems we are currently using either the Foxit reader or the PDF X-Change viewer from WINE, which is obviously not the way it should be done. Docear is still a very new project, but it is used by several thousand researchers in their daily work just now. Any help you can provide is very much appreciated. Thanks for your time and best regards, Stefan (Product Management and Research) -- Docear the Free & Open Source Academic Literature Suite
(In reply to comment #9) > Unfortunately I do not know a single PDF viewer for Linux which can do the > following: > - easily create notes and bookmarks in PDF files (like e.g. the Foxit > reader, Adobe Acrobat or the PDF X-Change viewer available for MS Windows) > and edit annotations created by these tools Okular can create and edit annotations. Not sure what you mean with bookmarks, do you mean outline items in the Table Of Contents? > - store the PDF files preferably incrementally (i.e. keep the annotation's > object numbers the same over all saved revisions of the PDF file --> this > might not be needed for future versions of Docear) Probably we don't do that, not sure how hard it'd be to make it work that way > - automatically copy the contents of highlighted text into a "note > annotation", so that Docear can read it and the user can modify it, e.g. by > adding additional data or explanations. (This is a very useful feature in > the PDF X-Change viewer) We don't do that, what's the use case for a standalone user? Why would someone need to create a note with the exact contents of the text he is highlighting? > - and open a PDF file at the location of a specific annotation, e.g. by > passing the annotation's object number to the PDF viewer (Okular can open a > PDF file on a specific page, which is not optimal for our use case, but > nevertheless very useful) By object number you mean the PDF object ref? > Is there a way to implement these features into Okular? All is possible, you just need time, which unfortunately we don't have much, so if you guys have anyone that can help that'd be awesome
Created attachment 81272 [details] highlighted-text.pdf > - automatically copy the contents of highlighted text into a "note > annotation", so that Docear can read it and the user can modify it, e.g. by > adding additional data or explanations. (This is a very useful feature in > the PDF X-Change viewer) > We don't do that, what's the use case for a standalone user? Why would someone > need to create a note with the exact contents of the text he is highlighting? Specifically, the use case scenario is that other programmers can hook in to the highlighted text via the note annotation. In academic literature suites, users can then search their highlighted text, manipulate it in various ways, or add to it. For example, in Docear, when it is used with a PDF viewer that supports the standard way of handling highlighted, imports the highlighted text and "automagically" makes it part of a mind map. See the attached for a visual implementation of copying highlighted text in to a note.
Created attachment 81283 [details] File containing annotations from both the Foxit Reader and Okular. File containing annotations from both the Foxit Reader and Okular.
> Okular can create and edit annotations. Not sure what you mean with > bookmarks, do you mean outline items in the Table Of Contents? Please find the PDF file attached to my previous post (https://bugs.kde.org/attachment.cgi?id=81283). - I have created a note on page 1 using the Foxit Reader. It is visible and can be edited in all major PDF viewer applications supporting annotations - tested in the past for at least: Adobe Acrobat Professional, Foxit Reader, PDF X-Change Viewer, Evince (standard PDF viewer in GNOME), Preview (MacOS standard PDF viewer) and Skim (MacOS). In Okular (v0.16.5 in Debian/sid) the annotation is visible but can't be edited. - Using Okular I have created an additional annotation on page 2. It is fully operational in Okular but invisible in at least Evince, the PDF X-Change Viewer and the Foxit Reader. - Docear can import annotations from all listed PDF viewers above using exactly the same method, however Okular annotations are not imported, which is not surprising if the other Readers also can't see these annotations. > > - store the PDF files preferably incrementally (i.e. keep the annotation's > > object numbers the same over all saved revisions of the PDF file --> this > > might not be needed for future versions of Docear) > > By object number you mean the PDF object ref? I am referring to the "object number" referenced in the Adobe PDF standard v1.7 (http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/pdf_reference_1-7.pdf) on page 63: “Together, the combination of an object number and a generation number uniquely identifies an indirect object. The object retains the same object number and generation number throughout its existence, even if its value is modified.” Incremental search is keeping these object numbers the same over all saving attempts. However we have implemented another way in Docear to identify annotations, so this is not crucial for us. > All is possible, you just need time, which unfortunately we don't have much, > so if you guys have anyone that can help that'd be awesome Okular is a great PDF viewer and we would really like to get involved into the development. Unfortunately we are very busy working on Docear and related projects and don't have the time to work on Okular. We have hoped to find an easy answer (e.g. that's it is already implemented in latger versions of Okular) or your help. Best regards, Stefan
Hello Albert, I have found out just now, that Okular is not saving the annotations in the PDF file itself but in xml metadata in "~/.kde/share/apps/okular/docdata/". Does Okular support annotations inside of the PDF file? Storing annotations in metadata is fine for a single user, but if a researcher wants to share his commented paper with a colleague, it won't work. Maybe my version 0.16.5 of Okular is too old or there are some hidden preferences? Thanks for your help. Best, Stefan
(In reply to comment #14) > Hello Albert, > > I have found out just now, that Okular is not saving the annotations in the > PDF file itself but in xml metadata in "~/.kde/share/apps/okular/docdata/". > > Does Okular support annotations inside of the PDF file? > Storing annotations in metadata is fine for a single user, but if a > researcher wants to share his commented paper with a colleague, it won't > work. > > Maybe my version 0.16.5 of Okular is too old or there are some hidden > preferences? > > Thanks for your help. > > Best, > Stefan Hi, Yes, Okular support annotations: http://docs.kde.org/stable/en/kdegraphics/okular/annotations.html but you should use "Save as..." to save them in your file. BTW I can use Okular to read, change and then use the annotations in Foxit Reader (wine) for the file you have attached. Okular 0.17.60, poppler 0.23.1, Mageia 3 (x86-64) here. Best regards, Yuri
Save as... started to work properly from poppler 0.20 on. (see: http://docs.kde.org/stable/en/kdegraphics/okular/annotations.html)
Thanks for your help. :) But, is there a reason why there is no "Save" option like in other applications to store the file directly without previously opening a file chooser? Cheers, Stefan
Nothing to do with this bug, but it has to do with the fact that saving into the xml is older than into the .pdf and that we support much more file formats than .pdf so we need to think a good way to accomodate the old use patterns with the newer features.
(In reply to comment #14) (This is OT, but may help to bug reporters for testing.) @Stefan Langer These are the steps to enable storing annotations in okular from debian/sid (suggested by Florian Kulzer): (from http://lists.debian.org/debian-kde/2013/07/msg00067.html) # aptitude build-dep okular # aptitude install libpoppler-dev/experimental libpoppler-qt4-dev/experimental # aptitude install libtiff4-dev libjpeg8-dev $ apt-get source okular $ cd okular-4.10.5/ $ dch -l +annot $ dpkg-buildpackage -d -b -rfakeroot -us -uc $ cd .. # dpkg -i libokularcore2_4.10.5-1+annot1_amd64.deb okular_4.10.5-1+annot1_amd64.deb okular-extra-backends_4.10.5-1+annot1_amd64.deb The problem is that the packaged okular is not compiled with the libpoppler-dev from debian/experimental.
*** Bug 328028 has been marked as a duplicate of this bug. ***
Please could some of the Okular ppl do they magick so we (academics working on linux) can have usable pdf reader (native to linux) with annotation that work with docear! All my research, lab work and paper writing is organized true docear. At this point docear can see notes in okular, but dosnt see highlighted text. Sooo I need to save the highlighted text like inline note EVERY TIME. Its boring and its take time :((((. Can this be added as automatic in Okular for those who need this?
The feature to save highlighted text in a comment is a killer. Essentially, it allows the annotations to be extracted out and one gets a nice summary of what the article says! That summary can then be used without the master document. I see that PDF-Xchange Editor and Viewer have settings for the same. Similarly, the ability to save annotations in the PDF is much appreciated. However, it would be even better if there could be a per-document setting that could be toggled for the same. It is extremely tedious to click "Save As ..." and select a file, when one could simply type "Ctrl+S". Another challenge with saving it as XML outside the file happened with me. I had to replace the file multiple times to get a pristine copy only to realise that the file was clean, but the annotations directory had annotations in it. I find Okular to be an awesome PDF reader, and also used it on Unity - but we really need to bring in these features to make it useful in complex workflows and ensure that GNU/Linux thrives on the desktop.
Created attachment 89131 [details] Foxit feature request as submitted for copying highlighted text into comment field. This document is a request submitted to the Foxit team to build a feature that copies the highlighted text into the comment field.
Created attachment 89132 [details] Commenting Option in PDF XChange Screenshot Screenshot showing commenting option as present in PDF XChange Viewer
Created attachment 89133 [details] Comments extracted from a PDF using PDF XChange Viewer This shows how comments that have been put in a file using PDF XChange Viewer can be extracted into another PDF. Thus, one can simply send the second PDF to anybody. Example: reviewers can simply send the set of comments to the paper authors without sending the whole file. This could possibly allow merging of comments from various authors into a PDF document - just a wild thought.
I can only confirm that this would indeed be an awesome feature!
It would be awesome, yeah, just that noone has told me how a user is supposed to tell okular which annotation should be focused.
Created attachment 90997 [details] attachment-26200-0.html This is my understanding of the problem. I could, and most likely am, wrong. In external application, create annotation. Annotation is created and assigned an Object Identifier. The file is saved. At a later date the PDF file is accessed using a script or the same application that searches for the Object Identifier and pulls its content into a file or opens the pdf at the page of the annotation. The logical method would be to pass the Object Identifier via command line. The proper method, according to the PDF 1.7 spec, page 63, is to assign unique Object Identification numbers to all indirect objects and then to increment content while maintaining the original Object Identifier. The examples are in Appendix G, pg. 1075. Pretty much all viewers that allow annotations use a short-cut, and increment the Object Identifier with each write as annotations change or other segments are added to the file. So for example, I could open a pdf in Adobe Acrobat Viewer, make an annotation, take note of the Object Identifier and then save the file. I could then open the file in any other viewer, change the annotation by adding or removing content and then save the file. This would break the Object Identifier by changing it, making any attempt to go to it in the future using the original Object Identifier futile. If the Object Identifier were to remain constant, then pulling it up at a future date with a different application or script would be possible. As it stands, it isn't. Chris On Mon, Feb 9, 2015 at 11:07 AM, Albert Astals Cid <aacid@kde.org> wrote: > https://bugs.kde.org/show_bug.cgi?id=318798 > > --- Comment #27 from Albert Astals Cid <aacid@kde.org> --- > It would be awesome, yeah, just that noone has told me how a user is > supposed > to tell okular which annotation should be focused. > > -- > You are receiving this mail because: > You are on the CC list for the bug. >
What does an external application has to do with this bug? You're asking for a feature to open a pdf from command line in an annotation, at which point and why would it have to do anything with an external application?
Created attachment 90999 [details] attachment-7612-0.html Okular is a PDF reader. It is multi platform. The ability to make an annotation, assign it an Object Identifier and then have the identifier available to open the pdf again at exactly the same position is highly desirable for academics who do research. Having that identifier stay unique through several edits of the annotation or the addition of further annotations in the subject pdf and to be able to toss said pdf file over the internet to a colleague for their input (as annotations) and then back to the user over the internet to open it again at any of the annotations that the identifier was previously noted for by an external application, be it a reference manager or a script. The goal is to allow another application (like Docear or a script) access to the Object Identifier and the content of the annotation. Poppler allows the pdf to be "read" by the script, then a simple diff to note the change (Object Identifier) before and after the annotations, log the Identifier, send the pdf out for comment, get it back, pull the annotations into the outliner and open the pdf in Okular at the location of the annotation, whether it be a highlight of a note wouldn't matter, the content is what matters. I use a multi-platform outliner called Leo as my primary editor and information organizer. I want to be able to read a pdf, annotate it, send it off for comments, bring it back, open it to any randomly desired Object Identifier, read it and in the end pull the annotations out as text, via a python script and into the outliner. The hold up is that there is no cross platform pdf reader that supports a static Object Identifier. And the only way to make it work in academia is for the pdf to be standard enough to make annotations in a wide variety of readers and the only way to make that happen is for there to be a standard way of handling Object Identifiers. Chris On Mon, Feb 9, 2015 at 1:34 PM, Albert Astals Cid <aacid@kde.org> wrote: > https://bugs.kde.org/show_bug.cgi?id=318798 > > --- Comment #29 from Albert Astals Cid <aacid@kde.org> --- > What does an external application has to do with this bug? You're asking > for a > feature to open a pdf from command line in an annotation, at which point > and > why would it have to do anything with an external application? > > -- > You are receiving this mail because: > You are on the CC list for the bug. >
Veeeeeeery long text, you're still not telling me how you as a user are going to tell in the command line which annotation you want to open, are you going to tell me "182 2" so i open generation 2 of object 182? How are you even going to know the anotation you want it's object 182?
Created attachment 91014 [details] attachment-16065-0.html Using poppler, examine the file and read a "copy" as text into a database. Make the annotations. Then again using poppler, read the annotated file. Diff to find the Object ID, make note in the database. Manipulate the crap out of the file. Add annotations, delete annotations, edit annotations. As long as the annotation still exists with its unique identifier, I can pull the content out of the pdf via a python script and supply okular with a command line argument to open the file at the correct location. It would be simpler if the pdf reader supplied the Object Identifier as part of what is visible about the annotation. Chris On Tue, Feb 10, 2015 at 12:44 PM, Albert Astals Cid <aacid@kde.org> wrote: > https://bugs.kde.org/show_bug.cgi?id=318798 > > --- Comment #31 from Albert Astals Cid <aacid@kde.org> --- > Veeeeeeery long text, you're still not telling me how you as a user are > going > to tell in the command line which annotation you want to open, are you > going to > tell me "182 2" so i open generation 2 of object 182? How are you even > going to > know the anotation you want it's object 182? > > -- > You are receiving this mail because: > You are on the CC list for the bug. >
None of that seems very user oriented if you ask me, so my user has to use a tool he doesn't know about to provide a magic number, or i have to show the user a number in the UI he has no clue what it is about. Sure i can see how there's a handful of people in the world that would need this functionality, but seems pretty corner-case-y to be honest. So if someone wants to come up with patches that implement this, we can discuss them on reviewboard, otherswise i don't think it'll ever happen from my side (surely not with the amount of time i have for okular)
Created attachment 91016 [details] attachment-16962-0.html No worries. I learned a bunch about poppler and Docear actually used a work around, but it only works with PDF-XChange viewer, which is not cross platform. When they hit the wall with this problem a while back I started working to see if I could find a way, but as I am not a programmer, it pretty much ended there. Now I just database the article and make my annotations in Leo, which actually cuts keystrokes while reading, but does nothing for easy access to annotations made by others.You can't have everything I guess. Chris On Tue, Feb 10, 2015 at 1:59 PM, Albert Astals Cid <aacid@kde.org> wrote: > https://bugs.kde.org/show_bug.cgi?id=318798 > > --- Comment #33 from Albert Astals Cid <aacid@kde.org> --- > None of that seems very user oriented if you ask me, so my user has to use > a > tool he doesn't know about to provide a magic number, or i have to show the > user a number in the UI he has no clue what it is about. > > Sure i can see how there's a handful of people in the world that would need > this functionality, but seems pretty corner-case-y to be honest. > > So if someone wants to come up with patches that implement this, we can > discuss > them on reviewboard, otherswise i don't think it'll ever happen from my > side > (surely not with the amount of time i have for okular) > > -- > You are receiving this mail because: > You are on the CC list for the bug. >
Created attachment 91020 [details] attachment-29821-0.html I've alterted the Docear developer to get his input on this. On Tue, Feb 10, 2015 at 4:10 PM, Chris George <technatica@gmail.com> wrote: > https://bugs.kde.org/show_bug.cgi?id=318798 > > --- Comment #34 from Chris George <technatica@gmail.com> --- > No worries. I learned a bunch about poppler and Docear actually used a work > around, but it only works with PDF-XChange viewer, which is not cross > platform. When they hit the wall with this problem a while back I started > working to see if I could find a way, but as I am not a programmer, it > pretty much ended there. Now I just database the article and make my > annotations in Leo, which actually cuts keystrokes while reading, but does > nothing for easy access to annotations made by others.You can't have > everything I guess. > > > > Chris > > > On Tue, Feb 10, 2015 at 1:59 PM, Albert Astals Cid <aacid@kde.org> wrote: > > > https://bugs.kde.org/show_bug.cgi?id=318798 > > > > --- Comment #33 from Albert Astals Cid <aacid@kde.org> --- > > None of that seems very user oriented if you ask me, so my user has to > use > > a > > tool he doesn't know about to provide a magic number, or i have to show > the > > user a number in the UI he has no clue what it is about. > > > > Sure i can see how there's a handful of people in the world that would > need > > this functionality, but seems pretty corner-case-y to be honest. > > > > So if someone wants to come up with patches that implement this, we can > > discuss > > them on reviewboard, otherswise i don't think it'll ever happen from my > > side > > (surely not with the amount of time i have for okular) > > > > -- > > You are receiving this mail because: > > You are on the CC list for the bug. > > > > -- > You are receiving this mail because: > You are on the CC list for the bug. >