Atom-LaTeX icon indicating copy to clipboard operation
Atom-LaTeX copied to clipboard

Use viewer for all PDFs

Open banesullivan opened this issue 6 years ago • 6 comments

Would it be possible to set the viewer that is shipped in this package as the default viewer for all PDFs in Atom?

The viewer you all have made here is far better than any other PDF viewers for Atom that I have seen! I would love to be able to open all PDFs in Atom using the viewer in this package rather than other packages.

banesullivan avatar Apr 24 '18 05:04 banesullivan

Hi, This is currently not possible, but might it might be possible to add a 'Open with..' kind of command. Let me explore a bit, but no promises on a timeline.

ashthespy avatar Apr 24 '18 09:04 ashthespy

@ashthespy You can register the package as a URI handler, like this

Aerijo avatar Aug 27 '19 07:08 Aerijo

@Aerijo Thanks for the tip, I started working on pulling the pdf viewer from this package out into it's own package, but didn't get down to publishing it. Do you have an idea/roadmap of what your planning with your atom-pdf-view-plus package?

ashthespy avatar Aug 27 '19 09:08 ashthespy

Definitely want to add synctex support, like pdf-view has. I'll probably model the viewer side of things on this package and Latex-Workshop. Also things like remembering zoom, position, tool state, etc., when the PDF is refreshed.

Beyond that, finding ways to insert theme styles, instead of hard coding them.

Aerijo avatar Aug 27 '19 09:08 Aerijo

Cool, will keep an eye out!

ashthespy avatar Aug 27 '19 09:08 ashthespy

@ashthespy It's almost done. Position is remembered, and the user theme is somewhat used (the body is transparent, so it kind of just shows through).

Instead of built in synctex, I've opted to go with a generic interaction service pdfview. Packages can subscribe to click, doubleclick, (and eventually more) events from individual PDFs. The position of the click is given in PDF points, to keep it generic. The consumers can also tell the PDF to scroll to a certain position. This makes it easy to implement a small synctex service, while keeping the package itself language agnostic. Though I'll probably add it as a configurable option anyway.

My goal with the service is to make it good enough to replace the built in viewer here. I plan to add more context about the clicks (which buttons, is ctrl held, etc.), and scroll + pagechange + keypress subscriptions.

Aerijo avatar Sep 14 '19 11:09 Aerijo