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

discussion: addition of jsPDF to download PDF #25

Open
r2evans opened this issue Sep 28, 2023 · 4 comments
Open

discussion: addition of jsPDF to download PDF #25

r2evans opened this issue Sep 28, 2023 · 4 comments

Comments

@r2evans
Copy link

r2evans commented Sep 28, 2023

Hello, Dean! Have you considered adding the capability to download PDFs in addition to PNGs? The jsPDF javascript library supports this and works with html2canvas.

Links:

@daattali
Copy link
Owner

daattali commented Oct 14, 2023

I have not considered PDFs before, but I did initially consider allowing choosing different file formats, and I decided against it. The main goal of shinyscreenshot is to allow a way to capture the contents in a saveable format, and I came to the conclusion that the exact format is not as important, because once you have it exported to one format, it's very easy to convert to any other format you want. I did not want shinyscreenshot to get overly complex (both feature bloat-wise and from a code maintenance point of view), which is why I decided to not give an option.

That said, PDF is different enough from image formats so if there is very minimal (and clean) code that can be added which will seamlessly support exporting to PDF instead of PNG, I'd be happy to include it. If it's not simple, I would prefer not to, because I want the focus of this package to remain taking screenshots, not dealing with file formats across devices.

@daattali
Copy link
Owner

@r2evans have you tried to see how much work it would be to create a PDF instead of PNG?

@r2evans
Copy link
Author

r2evans commented Nov 29, 2023

Not yet. My initial look determined that it would take a bit more focused effort to see how best to fit it in (both your code base and seeing how the other links worked through it), so I got distracted on other things. I recognize it would be far simpler to you if I came up with PR, I don't know if that's going to happen quickly.

@daattali
Copy link
Owner

daattali commented Dec 2, 2023

No rush! I have enough work on other packages to keep busy (and of course, on paid clients too :) ) so if you ever find time to look into it, let me know! It is a nice idea so it would be useful for many people if an elegant solution is found.

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

No branches or pull requests

2 participants