quran / quran.com-frontend

quran.com frontend
https://quran.com
MIT License
998 stars 361 forks source link

PDF export #529

Closed mmahalwy closed 7 years ago

mmahalwy commented 7 years ago

We get this request ALL the time. So here it goes: how do we make a PDF export of what the user is reading. For example, a user can choose to export the whole surah, or a range of ayahs, given the translations options they currently have set or we give them the option to set. It should look exactly like it looks now without the non-text components (nav, footer, audio player).

Thoughts? I am confident we can do this and have some ideas

mmahalwy commented 7 years ago

CC @naveed-ahmad

naveed-ahmad commented 7 years ago

Internet is full with pdf Quran already. One plus point in exporting from Quran.com is option to include multiple translation.

Once we've word-to-word translation in other languages, then exporting pdf with word-to-word ( in multiple languages) would be a great feature.

There are few great gems for exporting pdf in ruby, I believe using reactjs for exporting would be more difficult.

How about this workflow

Export options could be

this should be pro feature :D

naveed-ahmad commented 7 years ago

A good example for pdf format: It has word-to-word and ayah translation in Urdu

word to word

mmahalwy commented 7 years ago

While I agree with 99% of what you pointed out, the one thing I disagree with is that the API creates the PDF. If we have the PDF on the fronted, which technically is a backend service (by expressjs). We will be able to use the same styles, and have react render the PDF rather than having to duplicate the code on the API service.

It's possible and I think it's easy to implement.

mmahalwy commented 7 years ago

Might need the API to allow to get all ayahs of a Sarah

naveed-ahmad commented 7 years ago

Rendering pdf with multiple Surah, translations and maybe word by word translation could be very time consuming. That's why i proposed using API( and background job ) to do this job.

mmahalwy commented 7 years ago

It'd only be for that Surah only. We'd like people to come back to quran.com :)