Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FR] Extract Highlights #49

Closed
Friedolito opened this issue Feb 16, 2024 · 9 comments
Closed

[FR] Extract Highlights #49

Friedolito opened this issue Feb 16, 2024 · 9 comments

Comments

@Friedolito
Copy link

First of all thanks!!
I never really used PDF in obsmd, but it's now changing and that in part of PDF++.
I just scrolled trough the settings and it's crazy how big this is. Props!

One thing I would find really useful, is to extract all highlights of a PDF and be able to paste them in a .md file, with the backlinks to the pdf.
I think it's something a lot of people could find helpful. :)

@RyotaUshio
Copy link
Owner

Thanks!

So your idea is that, although we are already able to copy & paste each highlighted text with a link to the corresponding location in the PDF one by one manually, it would be even better if we could do this for all highlights just by running a single command or something, right?

I agree such a functionality will be useful especially for those who already have a bunch of PDFs with highlights.

@Friedolito
Copy link
Author

Exactly!
So it fits in a process of first reading the pdf and highlighting, then exporting those highlights and then working with them in obsmd.

@RyotaUshio
Copy link
Owner

RyotaUshio commented Feb 17, 2024

I see, my question is then why don't you add highlights in Obsidian and use the auto-paste command?
This way, you can do the whole process at once.
(A drawback is the flickering at the moment Obsidian reloads the modified PDF)

Screen.Recording.2024-02-17.at.18.00.09.mov

Setups:

  • Install PDF++ ver. >= 0.35.12
  • Assign a hotkey cmd+opt+C to the command "Copy & auto-paste link to selection or annotation"
  • In PDF++ settings:
    • Enable editing PDF files and set the annotation author-name
      image
    • in the auto-paste options, set "How to open target markdown file if not opened" to "RIght sidebar" (you can turn off "auto-hide sidebar" if you want to)
      image
  • In the PDF toolbar, turn on the toggle "Write to file directly"

After that, you will be able to use the hotkey cmd+opt+C to add a highlight to the selected text and auto-paste the formatted link to a markdown file.

@RyotaUshio
Copy link
Owner

Released in 0.35.13!

@Friedolito
Copy link
Author

Damn, this is fast!!
Thank you so much, for putting it in :) !
(Is there an way to change the layout of the extraction? Is it via the custom CSS file?)

I have my workflow with an Ipad and highlighting there.
For me its a more natural way to read.
But I will check out the set-up in obsidian, and see if it works for me.

@RyotaUshio
Copy link
Owner

RyotaUshio commented Feb 18, 2024

Is there any way to change the layout of the extraction? Is it via the custom CSS file?

What do you mean by "layout"? If you are referring to the template, you can change it from the dropdown menu in the PDF toolbar.

Copy format:
image

e.g.

> [!{{calloutType}}|{{colorName}}] {{linkWithDisplay}}
> > {{text}}
> 

Display text format (e.g. {{file.basename}}, page {{page}}):
image

You can also add your own custom template from here:

image

For the colored callouts, see here in the settings pane:

image

@Friedolito
Copy link
Author

Neat that is exactly what I wanted 😇

But I played around a bit and now it is broken :D
The PDFs won't open anymore, its just a blank tab.

The developer consoles displays:
Screenshot -2024-02-18 at 21 45 37@2x

Should I open a seperate issue?

@RyotaUshio
Copy link
Owner

RyotaUshio commented Feb 18, 2024

That's strange, I have never seen that error...

Should I open a seperate issue?

Yes, please do so if reloading the app doesn't help.
Providing the following information will help me identify the cause of the problem:

  1. From the command palette, run the command "Show debug info" and copy & paste the result
  2. Again, from the command palette, execute the command "PDF++: copy debug info" and then paste the result

@RyotaUshio
Copy link
Owner

RyotaUshio commented Feb 18, 2024

FYI, if you don't mind losing your PDF++ settings, I guess deleting <VAULT ROOT FOLDER>/.obsidian/plugins/pdf-plus/data.json and reloading the plugin will fix the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants