product-backlog icon indicating copy to clipboard operation
product-backlog copied to clipboard

Can I export PDF annotations?

Open tmabraham opened this issue 5 years ago • 12 comments

I would like to save a PDF with the annotations I had made on them. Is this possible? If not, would there be an easy way to do this with the API? I am new to Hypothesis API so please point me to the best resources. Thanks!

tmabraham avatar Dec 06 '19 05:12 tmabraham

Any update?? It seems like the developers are not checking the issues?

tmabraham avatar Jan 14 '20 02:01 tmabraham

@tmabraham you can use judell's script.

Here what I did to retrieve the annotations of a specific annotation:

from hypothesis import Hypothesis
h = Hypothesis(username=<username>, token=<token>)
annotation = h.get_annotation(<annotation_id>)

Otherwise, you can get all annotations from a specific group:

from hypothesis import Hypothesis
h = Hypothesis(username=<username>, token=<token>)
annotations = h.search_all(params={'group': <group_id>})

However, the request takes a few minutes to complete--this last code took 8 min--and I don't know why. Look at the API to know more.

vitalwarley avatar Mar 12 '20 01:03 vitalwarley

@vitalwarley Thanks, but how would this help save the annotations to a PDF? Would I have to do that separately also in a Python script?

tmabraham avatar Mar 12 '20 02:03 tmabraham

I didn't try to see how to export the PDF with the annotations using this API yet. But there is some work going on to that end, I guess: https://github.com/hypothesis/product-backlog/issues/566

vitalwarley avatar Mar 12 '20 19:03 vitalwarley

A similar issue exists in our product backlog repo: https://github.com/hypothesis/product-backlog/issues/21

closing in favor of that one.

klemay avatar Mar 16 '20 15:03 klemay

@klemay Sounds good. But I am not completely sure if this is the same feature request. Importantly, if I understand correctly, the one you have linked is more broad regarding saving any annotations (from websites) as a PDF. I am more interested in taking the already existing PDF and adding the highlights and annotations directly to the PDF. I would think that the former is harder than the latter.

tmabraham avatar Mar 16 '20 20:03 tmabraham

4 years later: this still does not seem to have been addressed? :( Is there any way to donate to this effort/issue?

BlackHC avatar Feb 12 '24 12:02 BlackHC

We have added some general export functionality recently (eg. to text, CSV, HTML). See https://web.hypothes.is/help/exporting-and-importing-annotations/. We haven't implemented export to PDF-native annotations yet.

robertknight avatar Feb 12 '24 12:02 robertknight

Probably the most straightforward way to export annotations to PDF is, using the functionality mentioned by Rob above, select HTML as export format, then copy to clipboard, and then paste into any rich text editor (Google Docs, Microsoft Word, etc).

Once there, you should be able to save/export as PDF, as most rich text editors support that.

acelaya avatar Feb 12 '24 13:02 acelaya

@acelaya @robertknight My sincere apologies: I think you both miss the point.

This feature request is not about general export to PDF but about exporting PDFs with the annotations and highlights from hypothes.is included. Your suggestions (incl the original closing of this issue by @klemay) have repeatedly misinterpreted this feature request. Both I and OP have annotated and highlighted PDFs using the hypothesis plugin and now we would like to save the PDF with the highlights and annotations included to use it otherwise. This is very different from separately exporting comments into separate files using other formats, which might or might not include PDF or markdown etc.

Could you confirm that you understand what this feature request is about, and how it differs from what you said above?

BlackHC avatar Feb 12 '24 21:02 BlackHC

I understood the feature request to be what you expressed. I just made a point of mentioning what export functionality we do currently have, in case that is useful to anyone following the issue.

I agree this issue is distinct from https://github.com/hypothesis/product-backlog/issues/21. That just says "printable version of a document", whereas this is specifically about exporting an annotated PDF with the annotations embedded, most likely as native annotations.

robertknight avatar Feb 12 '24 22:02 robertknight

Thank you very much! This is not the right venue, but if there is any way to help with this please let me know. I haven't seen any obvious way to subscribe to hypothesis, but I'm personally using it a lot, both directly as well as through the obsidian annotation plugin, and it is a big part of my daily workflow

BlackHC avatar Feb 12 '24 23:02 BlackHC