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

Support server side rendering for PDFs #7

Closed
zoey-kaiser opened this issue Feb 1, 2023 · 6 comments
Closed

Support server side rendering for PDFs #7

zoey-kaiser opened this issue Feb 1, 2023 · 6 comments
Assignees
Labels
enhancement New feature or request

Comments

@zoey-kaiser
Copy link
Member

Describe the feature

We want to offer developers to opportunity to generate their PDFs server side for more security. In order to do this we must add a new server side function to generate and export the pdf.

A good starting point is this issue:
parallax/jsPDF#2248

Additional information

No response

@zoey-kaiser zoey-kaiser added the enhancement New feature or request label Feb 1, 2023
@zoey-kaiser zoey-kaiser self-assigned this Feb 1, 2023
@mklueh
Copy link

mklueh commented Feb 3, 2023

Just curious, will this happen on every page hit or just once during the build? would be great to have some control over it. Maybe sometimes you want to generate something on demand, and sometimes you just want to serve a pre-generated PDF

@madsh93
Copy link

madsh93 commented Feb 4, 2023

Exciting. Can't wait to see where this leads.

Would be nice if you could pass it some HTML with Tailwind Style on a server route and have it generated. But it's probably to much to ask for.

It would be a tremendously needed feature for me. I've been tr Puppeteer which worked fine, but was slow and difficult to deploy in serverless environment due to the 50mb constraint.

@zoey-kaiser
Copy link
Member Author

Just curious, will this happen on every page hit or just once during the build? would be great to have some control over it. Maybe sometimes you want to generate something on demand, and sometimes you just want to serve a pre-generated PDF

Hi @mklueh! I am currently planing to first work on a "SSG" type rendering system. So regeneration with every load, to allow for real time data on the PDF. However adding a statically generated PDF at runtime could make sense to implement as well, however it would have less priority for me for now!

@zoey-kaiser
Copy link
Member Author

Would be nice if you could pass it some HTML with Tailwind Style on a server route and have it generated. But it's probably to much to ask for.

I am looking into a way to handle this, as it is super important for me! I am currently at a point where I know there is a way to generate pure html from a vue component using renderToString(). I am now looking into how I can generate a JS file from a vue file (which is a bit harder and I am still looking into).

One of my approches is currently looking into the server Nuxt 3 "server components", but I can keep you updated when I made some process!

It would be a tremendously needed feature for me. I've been tr Puppeteer which worked fine, but was slow and difficult to deploy in serverless environment due to the 50mb constraint.

I totally get it! I have had similar issues (not with PDF but with Social Media SEO Previews). I hope to find an elegant way to handle these use cases for Nuxt 3. It will also prove valuable as I can then move onto other advanced template use cases (such as mail, SEO Previews and more!)

@fanckush
Copy link

Is this still planned?

@zoey-kaiser
Copy link
Member Author

Taken over into #25 and began working on an implementation in #26.

Lets move all discussions about this into the issue / PR! Sorry for the big delay on this, I wish I could have started this earlier, but focus sadly shifted away from this project 😓

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants