Export info to a PDF

Hi, have information in text inputs, buttons, dropdowns forms, etc… I want to export all this information in a document and next send to an email or download.
How can I do that?

7 Likes

i need this too

Me too

bumping

got any idea?

Hi Guys!

Right now the only way to export files is directly from the database and to CSV format only.

I urge you all to submit a feature request here and help to make it happen!

Best of luck!
Doron. :slight_smile:

me too

I need also this feature !

You can achieve that by installing the NPM package pdfkit, and write some backend code to build your document.
To install the package, on the left panel, click the plsu sign (+) next to “Backend”, and choose “install node package”. Then search for pdfkit, and install it.
Next, you can write in your backend code:

import pdfkit from "pdfkit"

and then follow the code instructions here: http://pdfkit.org/

Good luck

Thank you for your comment !
I’m a novice and I don’t know where to insert the command line [import pdfkit from “pdfkit”]. Do I have to create a .jsw file and start with that line … hmm, not so easy because I did it and did a copy past from the given exemple on their website and this is not good. I did something like that:

import pdfkit from “pdfkit”

PDFDocument = require ‘pdfkit’

// create a document and pipe to a blob
var doc = new PDFDocument();
var stream = doc.pipe(blobStream());

// draw some text
doc.fontSize(25)
.text(‘Here is some vector graphics…’, 100, 80);

doc.end();

If you have another tips… don’t hesitate :slight_smile:

Regards.

@judoclubperon require and import are both ways to get objects and methods from another module. In WixCode, if you use require (the second line) it will mark it with red in the editor, but it will work in run time. So if you include that line, you don’t need the import line.

Regarding where to put it, it depends on your flow. Assuming you have some data on the client that you want to pass, and maybe some more data in a collection, you can use jsw file, and have a button on the client that will call your backend function in its onClick handler. For that part, see documentation and examples here: Velo Web Modules: Calling Backend Code from the Frontend | Help Center | Wix.com

Hope that helps. If you describe your flow I can try to give you more pointers where to start.
If you’re not a developer you might want to consider hiring someone.
If you’re a starting developer, it’s a good excersize :slight_smile:

I’m definitely bumping this. I think if we all team up together we can solve this. The problem I’m having is actually saving the PDF in a place where I can access it later on. I can’t save it in a public folder it seems, and I definitely can’t save it in a collection. This is going to be revolutionary once a solution is found.

Right, for now you can’t upload documents that you create in the backend to your collections, even if you have a column with type Document.
What you can do is upload it to some other service like amazon s3, etc.
Or, you can create it and immediately return to the user in the client, and not even store it.

Bumping…

I also need this.

Any update?

If Email-marketing WERE to work with BLOG you could just convert this Email into a pdf…

I am totally shocked you need to build some serverside js JUST to get a printable Version of a Blog Post???

We are an Judo club and it is mandatory to get the parents’ signature on a real paper when registering their children. So, the idea would be to have an online subscription form which can be download and printed in our format to be signed up…

Friends! I’ve found a solution, but it’s a slightly costly one. It (most often) requires a paid membership with 123FormBuilder. I currently pay $20 a month for “Gold”. The API allows you to build highly effective forms with electronic signatures, file uploads, etc. You can set up what happens on submit, and I’ve found the perfect configuration to have the API send an HTML email with the info, a PDF attachment formatted just like the email with all the same info, the uploaded files attached to the email as attachments, and enable “Do not show empty fields…”. This produces the exact effect that I think we have all been looking for. Everybody, I urge you to try this and reply with your results on whether or not this is what you needed.