PDF Freehand annotation not extracted by Zotfile.

I just noticed that the freehand selection is not imported with annotations. The PDF is flowable and not only a picture.

Also, is there a way for Zotfile to extract the highlights and underlines with colours? If Zotero doesn't have the exact colour codes at least approximate, eg light red just plain red?

Thanks.
  • edited November 17, 2017
    Currently, Zotfile extracts text from highlights, comments, and (I believe) text boxes, but not other annotation tools. For highlighting, there is an option to separate notes by color.
  • Sorry, what is an "otooon"? I've never heard it.

    Thanks.
  • edited November 17, 2017
    Sorry, "option".

    http://zotfile.com/

    Extract Annotation Color (thanks to RAG2ko)

    Zotfile now extracts the color of annotations. The color can be used in two ways: (a) To format extracted annotations: Just add some css styling to the hidden options for formatting. For example, change formatAnnotationHighlight to <p style="background-color:%(color);">"%(content)" (%(cite))</p>. The wildcard %(color) is replaced by the annotation color (you can also use %(color_category) for the color category—reddish is red etc). This styling has the same effect but looks a little better: <p><span style="background-color:%(color);">"%(content)"</span> (%(cite))</p> (b) To create separate notes for color categories: The hidden option pdfExtraction.colorNotes allows you to create a separate note for each color category (yellow, red, green etc annotations).
  • Oh okay :D. I was wondering what the hell was otooon :D.

    Right, I am not experienced with html coding and I am not sure what the instructions instruct. They are written for people adept in coding.

    * What I understand is that there is some "hidden option" where I can add custom code. That I presume is in: Zotero Preferences/Advanced/Config Editor
    — Although on the website they say there is a second file somewhere to edit to be safer. They do not recommend adjusting the direct file.

    * Then the custom code is confusing to me. Do I just copy and paste the one line, or must do each colour or something?

    I know this is awkward, but this stuff is really confusing for a non-coder.
  • edited November 17, 2017
    If you want to extract different colors as separate notes, open the Config Editor, search for "pdfExtraction.colorNotes", and set to "true".

    If you want all of your annotations in one note, but for the color to be included next the page number, etc., search in the Config Editor for "formatAnnotationHighlight", then change it from the default: <p>"%(content)" (%(cite))</p> to, for example, <p>"%(color_category) - %(content)" (%(cite))</p>

    If you want to change the background color behind an annotation to be the highlighted color, then replace the line with: <p><span style="background-color:%(color);">"%(content)"</span> (%(cite))</p>

    I'm not what you are referring to regarding any sort of external file to edit. There isn't one for this.
  • They talk about reference, I misunderstood it as a file, I told you the jargon is confusing to me.

    "All wildcards are now defined in the hidden preference zotfile.wildcards.default and can be changed by the user. But I strongly suggest that you do not change this preference. Instead, there is a second hidden preference zotfile.wildcards.user that allows you to add and overwrite wildcards (hidden preference can be changed in about:config). This is a preference is for advanced user without any error checking so be careful what you do! "

    Thanks for the reply. I will mess about. Your reply is much clearer.
  • The wildcards text you quote is about renaming files, not extracting annotations.
  • edited November 18, 2017
    Yeah man, it works! Amazing, thanks.

    Just to let you know, this method does not work. It just places the colour codes in plain text in front of the highlights.

    "If you want all of your annotations in one note, but for the color to be included next the page number, etc., search in the Config Editor for "formatAnnotationHighlight", then change it from the default:

    "%(content)" (%(cite))

    to, for example,

    "%(color_category) - %(content)" (%(cite))

    "
  • Yes, that is what I was intending for that.
  • But it just displays the code (ex. #FF0000) in front of the highlight, not the colours. Why would you intend for that? I am failing to see the use for it.

    Although I am not that bothered as this method: p>"%(content)" (%(cite)) works charms. Yet, I was curious to see the colours displayed in front of page numbers as it could be an interesting method too. But having no colours, only colour codes is not useful imo.

    Regards,
  • I see what you mean--after briefly glancing at the Zotfile code, I had thought it would give a label like "Red".
  • Have you tried %(color) instead of %(color_category) ? I agree $(color_category) should work given the documentation, but worth a try.
  • @bwiernik Yeah, no problem.
  • edited November 19, 2017
    @adamsmith No, still doesn't work when replacing "%(color_category)" with "%(color)". It displays the colour in RGB code instead of previously HEX code.
  • I reversed the code into this

    (%(cite)) "%(content)"

    so I can have the in-text and page numbers first. I think it's clearer that way.
    However, underlines are still without colours and the page numbers are at the back with those. It's as if the code for colour extraction doesn't affect underlines at all.
Sign In or Register to comment.