Skip to content

Conversation

@Autoparallel
Copy link

Notes

You mention in #10 that you want to do a release of this crate, which would be great! I also read through some of the issues you have which led you to pin to other versions of ratatui and ratatui-image.

If we can get beyond that, then this could be published to crates.io instead (which would definitely be preferred by many).

Running with these changes on my machine, I can't notice any poor performance, but there may be some issues with resizing my terminal. Using iTerm2 on MacOS.

Tasks

  • Removes github uses of ratty and ratatui-image
  • ???

Discussion

I came about this because I've been building learner as a means to have a nice database for research. Part of it can be seen as a replacement for things like Zotero, and I just set up a TUI with it and was hoping to use a TUI based PDF reader -- so I found this!

I'm curious if you'd also be interested in using lopdf instead of popplers-rs? This would be all Rust native and not have FFI to popplers bindings and I think would help this be more universally compatible.


I'm really happy to see this and help push it along! Let me know what I can do.

@Autoparallel
Copy link
Author

Just pinging on this here again -- no worries if you don't want to use this, but would still be interested in collaborating on this type of tooling!

@itsjunetime
Copy link
Owner

You mention in #10 that you want to do a release of this crate, which would be great! I also read through some of the issues you have which led you to pin to other versions of ratatui and ratatui-image.

Yes, I'd like to publish this, but the git-specific dependencies aren't preventing me from doing so. It's mostly just that I've been busy recently and haven't viewed it as a super high priority to get working as people can just use cargo install --git to the same effect. That, and the name tdf is already taken. I'll get around to it at some point soon lol.

Running with these changes on my machine, I can't notice any poor performance

Could you run the benchmarks I've set up in this repo to see what the performance effect of these changes are? You just need to:

  1. Save the performance before these changes by stashing them/checking out main and running cargo bench --bench rendering -- --save-baseline old
  2. Check out these changes again and run cargo bench --bench rendering -- --baseline old to compare these changes' performance with the old baseline
  3. Paste the results here

I personally feel like current main feels regularly too slow for me, so I'm worried about merging any changes that disable the changes I've made to improve performance as-is.

I'm curious if you'd also be interested in using lopdf instead of popplers-rs? This would be all Rust native and not have FFI to popplers bindings and I think would help this be more universally compatible.

I'd love to use a rust-native library for this, but unfortunately I can't find any that fits my needs. As far as I can tell, lopdf (and the many other pdf-manipulation libraries that exist in rust) support manipulating pdfs, but not rendering them. And, unfortunately, tdf cares most about just rendering them to images. I could work on adding support for such a feature to one of these libraries, like lopdf, but that would be a massive effort and I doubt that I have the domain-specific knowledge that it takes.

If you know of a rust-native library (or even a library that seems less difficult to work with from rust) that has support for rendering to images, I'd be happy to check it out for usage here. I just haven't found one yet.

@Kreijstal
Copy link
Contributor

I'd be interested in being able to compile install it from cargo for packaging purposes..

@Kreijstal
Copy link
Contributor

@Autoparallel Are you working on a version with lopdf ?

@Autoparallel
Copy link
Author

@Kreijstal I haven't started yet, but I'd be keen to since it would fit excellently with my current project!

@Autoparallel
Copy link
Author

@itsjunetime Thank you for your response! I'll give those benchmarks a shot soon.

Haven't looked into Rust-native PDF renderers yet -- wasn't sure if lopdf could do that or not as I just started messing around with this stuff.

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

Successfully merging this pull request may close these issues.

3 participants