toha icon indicating copy to clipboard operation
toha copied to clipboard

Adding PDF Shortcut

Open MarionMoseby opened this issue 3 years ago • 2 comments

Can I add this PDF shortcut to the theme?

MarionMoseby avatar Feb 03 '22 22:02 MarionMoseby

@hossainemruz give me the OK and I will implement it :p

MarionMoseby avatar Aug 06 '22 13:08 MarionMoseby

Sure. Go on.

hossainemruz avatar Aug 06 '22 15:08 hossainemruz

Hey! I will add this snippet if you don´t think it´s a problem

toniop99 avatar Oct 10 '22 17:10 toniop99

That will be great @toniop99

hossainemruz avatar Oct 10 '22 18:10 hossainemruz

Yes please! I wanted to do this, but havent found any time since. Maybe it can be added as a git submodule to preserve copyright? Not sure though

MarionMoseby avatar Oct 10 '22 18:10 MarionMoseby

Yes please! I wanted to do this, but havent found any time since. Maybe it can be added as a git submodule to preserve copyright? Not sure though

From what I'm reading there are certain issues that need to be changed manually because the project is not maintained. We have two possibilities:

Copy the project and make the necessary changes to make it work

Find another project with similar functionality

toniop99 avatar Oct 10 '22 18:10 toniop99

Hello! I have created this shortcode that use the embed pdf api from adobe

If you consider it would be a good option to add to the theme we can do it with no problem.

It not as easy as a native pdf viewer, because the user has to create an api on adobe console, but is an easy and beautiful option!

toniop99 avatar Oct 12 '22 20:10 toniop99

I would position myself against adding a privative piece of code to an otherwise open source theme, but this of course could just be optional. Maybe we could add this one as embed-pdf-adobe, and call the other one embed-pdf-native? I have it working on my computer, I can pushit asap if @hossainemruz agrees

MarionMoseby avatar Oct 17 '22 16:10 MarionMoseby

I agree with you @MarionMoseby. Native one should be the default choice. We can just name it embed-pdf or pdf. The adobe one could be available as an option.

hossainemruz avatar Oct 17 '22 17:10 hossainemruz

I think us all of you. If we don't want to add it because it is very invasive, maybe we can add to the documentation the option for anyone who wants to use it at your discretion.

toniop99 avatar Oct 17 '22 17:10 toniop99

The pdf.js library weights 15 mb. I am usually in favor of loading things locally, but maybe this is a bit too much to add to the repo? How do you feel, maybe use a CDN?

MarionMoseby avatar Oct 17 '22 19:10 MarionMoseby

I have no issue with CDN. However, other user might have. We have to make sure this library is loaded only when there is a pdf in the page. Otherwise, it will make the site heavy.

hossainemruz avatar Oct 18 '22 02:10 hossainemruz

Sorry @hossainemruz, I didn't see your message, although I think my commit fits what you are saying: the PDF.js library is only loaded when the PDF is being actively displayed on the page. One possible improvement could be adding a "download" button to the top menu; what do you think? Currently, it shows each page as an image

MarionMoseby avatar Oct 18 '22 10:10 MarionMoseby