-
-
Notifications
You must be signed in to change notification settings - Fork 9
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
Future outline for the NuxtPDF
module (v1.0.0)
#25
Comments
this is great! i'll test out the alpha release. |
NuxtPDF
moduleNuxtPDF
module (v1.0.0)
@fanckush thanks for your interest ❤️ I have already begun working on the core logic needed for many of these features to work! Free free to give feedback to me while you work. I will also be using this in a few internal projects and adding components and features based on what we need! You are also welcome to propose or add new components, that you need. Feel free to also add me on Twitter or Discord (tsuuki) if you want to discuss more! Note: There will still be some breaking changes to come that I am already aware of. Ill try to document these as best as possible! |
First thing that comes to mind when checking the initial SSR PR and while trying it myself: it's a lot to ask since the underlaying tech is different, having the ability to pass in a vue component (e.g.: PDFKit doesn't support that of course, one would need a headless browser (e.g.: puppeteer). I don't know the scope of this project, maybe going that far is beyond the goals of this project. Even on my project, i'm not sure what to do here 😅 I would love to define my invoices in simple vue components but I also would love to generate that on the server side and get the benefits of consistency |
I like it! This looks very promising :) |
Very intersting module 👍 Thank you for your great work on this |
Goal
Outline how development on NuxtPDF will continue. Decide on what to implement and how to properly execute on it.
Context
When first developing NuxtPDF we set a goal of adding a module that lets you convert Vue components into a PDF. This was done by using a html-to-pdf library. The vue component would be compiled to html and then rendered via the library. However, this method has many drawbacks, which lead to us not adopting this module into our development flows:
Therefore, we want to rewrite NuxtPDF to utilize a new method of PDF rendering that does not depend on rendering html to a PDF. This will make the PDFs more "stable" and allow for more complex PDF generation.
Server Side generation
In order to achieve this, we will move away from rendering html to a pdf and utilize a programmatic approach to define PDFs. For this we will make use of pdfkit, which includes functions to generate parts of a PDF. While this is not as easy or quick as developing a component and using it as a base, it will add the needed stability as well as allowing us to generate PDFs on the server side.
However, after testing pdfkit in our own projects we also noticed some shortcomings:
Improvements for Application side generation
This is pretty simple, but I plan to add a small collection of utility components, that can be used to properly structure the vue component. A few of these include:
DocumentPage
- which lets you select the page size (A4, A5, etc.)DocumentTitle
DocumentFooter
DocumentTable
The point of these components, is to make the start a lot easier. They will be "invisible" components, that only aim to help properly structure the page.
In addition to this, I also want to expand the docs to tackle:
Roadmap
In order to improve our module and maintain a high level of Developer Experience, we will implement the following features. Some features will be deprioritzed and pushed to later, to ensure we have a working minimal version before completing a full implementation.
pdfkit
and its functions on the server side via a nitro importpdfkit
in a custom function to include:localhost:3000/__pdfs
or via the Nuxt Devtools.This will allow us to have a solid base to work on PDFs in the future. While it is more complex then the current system, I think it will improve our PDFs as well as the DX compared to the native PDFkit package. Future expansions will include more components and improve DX even more. As someone who worked a lot on PDFs and with PDFKit I think the main features that contribute to this Modules worth are:
The text was updated successfully, but these errors were encountered: