pdf-rs / pdf_render

MIT License
112 stars 22 forks source link

Render PDF with Vello[WIP] #26

Closed videni closed 2 weeks ago

videni commented 3 months ago

This Pull Request is currently under progress and is not ready for merging, here are what this PR focuses on:

PDF

UI

What GUI libraries I checked

Goal

After evaluating all these features above, we will start to implement a full version of modern PDF note-taking, reader app that will be available for ALL platforms including MacOS, Linux, Windows, Android, IOS, also the web.

mermerico commented 2 months ago

Thanks for doing all this work! It seems like this is well on the way to becoming the best (fastest) open source PDF viewer! I'd like to contribute if possible (I'm a Rust newbie, but I have C++ experience). What (if any) UI framework were you thinking of using? My initial assumption was Xilem due to its relationship with Vello, but it seems like it's currently very early in its development. I would personally love to implement the basic UI of Evince: a scrolling list of pages in the main view and a smaller one as thumbnails. I think the key here would be to have a facility for lazily loading the pages according to what's currently in view.

Evince

videni commented 2 months ago

@mermerico , Xilem is not GUI yet, currently we have to wait, otherwise, we will do lots of duplicate works. I am evaluating the Iced GUI recently, I checked its source code, build a home page to show a list of PDF files on my local, it is well structured, high quality code, it seems very future proving. so I prefer the Iced GUI at the moment.

videni commented 2 months ago

By the way, I really dislike the phylosophy of Elm that Iced used to structure application logic, it results in lots of boilerplate codes, you can check this real project hecrj/icebreaker) from the founder of the Iced GUI. basically, it needs a big message tree you must define for all your views also a view tree to handle these message, and we have to dispatch the massage to its view from top to bottom manually. Comparing with the example from Xilem TodoMvc, Xilem is a great relief to me after experiment with Iced for 3 weeks.

mermerico commented 2 months ago

Iced looks like a good choice (although I agree it seems like you have to do a lot of boilerplate work). It looks like they haven't implemented a lazy view / infinite scrolling functionality so I think I might just roll my own. I'm thinking that for the pages and thumbnails view panes we can basically ignore the GUI library and render everything directly in Vello.

videni commented 2 months ago

@mermerico They have a list widget, but not in the master branch. Check branch feature/list-widget-reloaded instead.

mermerico commented 2 months ago

Oh, very cool! I missed that. Okay, it'll take me a bit to get fully acquainted with how Iced works. I'll let you know when I have a prototype!