Skip to content

Instantly share code, notes, and snippets.

@omz omz/gist:2134449
Created Mar 20, 2012

Embed
What would you like to do?
Highlighter plain text format
FooBar.pdf
================================================================================
p. 4 | highlight | yellow
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis
nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu
fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
culpa qui officia deserunt mollit anim id est laborum.
================================================================================
p. 5 | underline | red
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis
nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu
fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
culpa qui officia deserunt mollit anim id est laborum.
================================================================================
p. 6 | highlight | green
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis
nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu
fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
culpa qui officia deserunt mollit anim id est laborum.
================================================================================
@Teggy

This comment has been minimized.

Copy link

Teggy commented Mar 20, 2012

That looks great, already! Definitely easily parseable, yet human-readable.

One thing: How would you represent a note that has been attached to a highlight? In quotes, maybe?

================================================================================
p. 6 | highlight | green

Lorem ipsum d ... est laborum.

"This should read Lora, not Lorem."
================================================================================

Use case: in reviewing academic papers, you highlight/underline/strike-through a particular sentence in red (to indicate a flaw in the reasoning, say) and then attach a note that contains details of the flaw or suggest a remedy. Highlights and notes together could be automagically transformed into a peer review document for the paper. Would turn PDF Highlighter into a killer-app for academics.

@omz

This comment has been minimized.

Copy link
Owner Author

omz commented Mar 20, 2012

Good thought, completely forgot about that. Quotes are problematic, I think, because they could very well occur in the highlighted text as well. How about something like this:

================================================================================
p. 6 | highlight | green

Lorem ipsum d ... est laborum.
--------------------------------------------------------------------------------
This should read Lora, not Lorem.
================================================================================
@Teggy

This comment has been minimized.

Copy link

Teggy commented Mar 20, 2012

Yes, that would be a great format to use.

Would that scheme also cover note-only (no highlight) annotations placed on a page? Probably:

================================================================================
p. 6 | note | yellow

--------------------------------------------------------------------------------
This is a random yellow sticker.
================================================================================

(Whether the --------- would be actually needed here, is debatable. It would be consistent with the scheme, at least.)

I'd be all for an export formatter along these lines. It appears to be flexible, parseable, and readable at the same time.

@omz

This comment has been minimized.

Copy link
Owner Author

omz commented Mar 20, 2012

I think the dashes wouldn't be needed for note-only annotations, but it just occurred to me that notes would also have to include the icon somehow (in 1.5, notes can have different icons, like "questionmark", "comment", "star", and so forth).

Something like p. 6 | note(comment) | yellow could work. I might drop the p. though, because I'd like the format to be language-independent (in German, it would have to be S. otherwise).

I think I'm going to start experimenting based on this, I need to submit a bugfix update pretty soon anyway because the Dropbox login dialog cannot be cancelled right now...

@Teggy

This comment has been minimized.

Copy link

Teggy commented Mar 20, 2012

(I agree that p. or similar is redundant.)

All the best with the hacking. I definitely look forward to have PDF Highlighter do my reviewing for me. ;-) Many thanks for your quick and thoughtful responses.

@mchakravarty

This comment has been minimized.

Copy link

mchakravarty commented Mar 20, 2012

This format would definitely work for me (including the modifications you discussed for notes etc). Keeping it language independent is a good idea.

My use case is very similar to @Teggy's — i.e., I use Highlighter a lot to review academic papers and theses.

@omz Thank you very much for adding this feature!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.