foam icon indicating copy to clipboard operation
foam copied to clipboard

Incorporate PDF files.

Open Bazmundi opened this issue 2 years ago • 3 comments

Is your feature request related to a problem? Please describe.

Using FOAM, grabbing data from a PDF with cut and paste into FOAM is time consuming. But trying to capture the metadata for the cut (source document at least, if not page number etc.) a real pain.

So, linking from/to the PDF as a source of ideas requires overhead of cutting pasting a raft of additional metadata to keep track of information and linkages.

Describe the solution you'd like

As as user I would expect to, say, block text of a pdf pulled up in MSC, and push the cut text to a FOAM page. If prompted with a title, perhaps to a [[hyperlinked page]] injected onto a parent page. Maybe the metadata in the pdf can be used as an md filename in FOAM, to then act as a target for all text cut from it.

It may be enough for a FOAM page to just catch blocks of cut text for later hyper linking but once you open Pandora's box right?

If an xml file was paired with the pdf, there may be other functions that could be included provided a simulation of [[]] over the pdf view. Or other link types?

Even if a FOAM page catches the cuts, but the pdf viewer also pops "post it" notes or tags over the pdf file. If the pdf viewer has a layers concept, you might be able to do this without breaking into the pdf itself. As long as there is a paired xml holding the related meta-data. OR, DOH, JSON or YAML, or in an md file.

Describe alternatives you've considered

Whether something like https://github.com/tomoki1207/vscode-pdfviewer might be a start. To then modify to pick up highlighted or copied text and additional menus to push to a pre-set FOAM page. There seems to be hooks into a side menu. Couldn't find the right click menu in the code 😢. Is that pdf viewer layered?

Screenshots or Videos

No response

Bazmundi avatar Mar 08 '22 13:03 Bazmundi

Hi @Bazmundi, thanks for the proposal. I agree I would also love better PDF integration, not something we have really thought a lot of yet.

I have some questions about your notes:

As as user I would expect to, say, block text of a pdf pulled up in MSC, and push the cut text to a FOAM page

I am not sure I understand this sentence (what's MSC?)

If prompted with a title, perhaps to a [[hyperlinked page]] injected onto a parent page

Parent of?

If an xml file was paired with the pdf...

You lost me here, but I don't think this would be within the spirit of Foam. The info would need to live within the md file and be markdown friendly

Thanks again for submitting the proposal, let me know your thoughts to my points

riccardoferretti avatar Mar 08 '22 17:03 riccardoferretti

Not exactly what you describe, but a possible alternative could be to use the PDF Reader in Zotero for annotating your PDF, then something like MDNotes to export them to Markdown for use in Foam.

I don't know if this workflow is quite up and running yet, but might at least serve as inspiration.

Dominic-DallOsto avatar Mar 09 '22 09:03 Dominic-DallOsto

Hi @Bazmundi, thanks for the proposal. I agree I would also love better PDF integration, not something we have really thought a lot of yet.

I have some questions about your notes:

As as user I would expect to, say, block text of a pdf pulled up in MSC, and push the cut text to a FOAM page

I am not sure I understand this sentence (what's MSC?)

If prompted with a title, perhaps to a [[hyperlinked page]] injected onto a parent page

Parent of?

If an xml file was paired with the pdf...

You lost me here, but I don't think this would be within the spirit of Foam. The info would need to live within the md file and be markdown friendly

Thanks again for submitting the proposal, let me know your thoughts to my points

Sorry, MCS=Microsoft Code. Typo :)

The paired file was just the idea that to capture any metadata about the PDF may need a companion file, so whether it be binary, yaml or md etc would be up to the implementer.

Bazmundi avatar Mar 10 '22 23:03 Bazmundi

Although I would like deeper support for PDFs, I am gonna close this issue for now as I don't think we will get to it anytime soon, and it's slightly outside of Foam core scope.

For now PDFs can be linked as an attachment, and can be viewed via third party extension. There is no plan for deeper integration (e.g. link to a section) atm, happy to reconsider if there is enough demand and a technical path to it.

riccardoferretti avatar Nov 13 '22 22:11 riccardoferretti