Suggestion: Add Display of Pdf Comments

Bug #1020979 reported by Manuel Garcia Wolff on 2012-07-04
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Adam Reichold

Bug Description

It would be nice if qpdfview could display Pdf comments.
When I open a Pdf with comments in qpdfview 0.3beta3, I only see a yellow icon for each comment.
I cannot see the actual comment text.

Adam Reichold (adamreichold) wrote :


You are right, qpdfview does not yet support any of the annotations that the PDF standard defines. But since the poppler library does expose these features, I am definitely planning to look into this. But since I am still not completely satisfied with the basic features like rendering and navigation, I have not yet found the time to actually implemented something. So please, be patient.

If you'd like to help eventual progress with this, you could attach one of the affected files. Because the PDF standard defines several types of annotation, I would try to start by implementing those in the file you post.

Regards, Adam.

Changed in qpdfview:
status: New → Triaged
importance: Undecided → Medium
assignee: nobody → Adam Reichold (adamreichold)
Manuel Garcia Wolff (mgwolff) wrote :

Hello Adam,

I cannot attach the exact Pdf I tried to open, as it is work-related.
However, I know that the comments on that Pdf were created using the "Adobe Reader" software, so I have made a small sample, and have attached it to this bug.
Let me know if I can help out further.

Kind regards,

Adam Reichold (adamreichold) wrote :

Hello Manuel,

Ok, I started to have a look at it and qpdfview will now (i.e. the current revision of trunk) display the annotation text as a tool tip on hovering on the place holder. You can also click on it, change the text and save those changes using "Save copy...".

Of course this is no real interface yet and I am still thinking about how to do this best without adding to much complexity to the code base. Whether using inline display (i.e. inline to the document view) or a modal popup window. And so on...

Any comments are appreciated.

Changed in qpdfview:
status: Triaged → In Progress
milestone: none → 0.3.2
Manuel Garcia Wolff (mgwolff) wrote :

That's great, I will download the latest version and take a look.

In my opinion, comments should not be displayed inline with the actual Pdf text.
This can distract from the original Pdf and could also be confusing.

Various Pdf readers (e.g. Adobe Reader, evince) use a modeless, floating box to display comments.
On some readers, these boxes even open when you scroll past them.
I think that is very annoying behavior, which needlessly clutters the screen when various comments are present per page.
Most of the time, I probably want to read each comment in detail, so there is no reason to have all comments open at the same time.

Thus, a modal pop-up window sounds better to me.

Adam Reichold (adamreichold) wrote :

That's nice, the modal pop-up window was my favourite as well.

But, just now, I committed support for adding and remove (text and highlight) annotation if you have poppler version 0.20 or newer. Since this is documented nowhere at the moment:

To add annotations: Hold CONTROL (text) or CONTROL+SHIFT (highlight) and drag a rubber band around the region which is to be annotated. Upon release you will be asked for the content. (For text annotations, the region of interest can be much larger than the icon itself.)

To remove annotations: Hold CONTROL or CONTROL+SHIFT and right-click the annotation.

Let's see what can be done about that pop-up window...

Manuel Garcia Wolff (mgwolff) wrote :

I have just downloaded and tested rev 390.
I do not have poppler 0.20 installed, so I have not tested the add / remove annotations function yet.

I do like annotation text being displayed in a tooltip, as it allows you to quickly preview this text.
I guess it would be less comfortable if the annotation text was rather long.
Maybe you could consider keeping both the modal pop-up and the tooltip?
Of course, that has the draw back that you have to maintain two annotation display implementations at the same time.

Adam Reichold (adamreichold) wrote :

Ok, I added a modal pop-up window to create and edit annotations. I still have to decide on a way to determine the size of said window. You can leave by clicking somewhere else or pressing CONTROL+RETURN. (I also changed removal to just plain right-click. Do not what I was thinking there...)

And yes, I think one should have both tool tip and pop-up editor. (The tool tip is basically free in terms of code.)

Changed in qpdfview:
status: In Progress → Fix Committed
Manuel Garcia Wolff (mgwolff) wrote :

I tested rev 393 and I like it a lot.

I did notice that the modal pop-up width was too narrow for various comments, requiring me to scroll to the right to read the rest of the comment.
However, I think the pop-up size is fine, as to not obstruct the view of the underlying Pdf.
Instead, would it be possible for the comment text to auto-wrap?

On a different note, I noticed that the right-click menu now shows the page number you will be taken back to, that's also a great enhancement!

Adam Reichold (adamreichold) wrote :

Actually, word wrap is the default. :-) I explicitly disabled it, but I see no problem with enabling it which should be done in revision 395. (Good to know that you like the return-to-page change.)

Manuel Garcia Wolff (mgwolff) wrote :

Tested revision 395, it's perfect. No further comments from my side :)

Changed in qpdfview:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Related questions