Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding PDF Shortcut #522

Closed
MarionMoseby opened this issue Feb 3, 2022 · 13 comments · Fixed by #672
Closed

Adding PDF Shortcut #522

MarionMoseby opened this issue Feb 3, 2022 · 13 comments · Fixed by #672

Comments

@MarionMoseby
Copy link
Contributor

Can I add this PDF shortcut to the theme?

@MarionMoseby
Copy link
Contributor Author

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

@hossainemruz
Copy link
Member

Sure. Go on.

@toniop99
Copy link
Contributor

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

@hossainemruz
Copy link
Member

That will be great @toniop99

@MarionMoseby
Copy link
Contributor Author

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

@toniop99
Copy link
Contributor

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
Copy link
Contributor

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!

@MarionMoseby
Copy link
Contributor Author

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

@hossainemruz
Copy link
Member

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.

@toniop99
Copy link
Contributor

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.

@MarionMoseby
Copy link
Contributor Author

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?

@hossainemruz
Copy link
Member

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.

@MarionMoseby
Copy link
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants