Html to PDF

Hello I can’t find the html to PDF option as indicated in a post, see the attached photo. my server is PHP

That’s a custom extesion developed by @sid and @nshkrsh, not a core Wappler functionality:

2 Likes

Thanks Teodor
on occasion it would be great if it could be in the official version ^^

1 Like

html to pdf:

does this work in the current version of Wappler? Is this something which is purchaseable and easy to install?

Thanks,
Rick

Yes it works and it’s free to use. Check the explanation in the topic :slight_smile:

I’m trying to install composer so I can add the mpdf library but I’m realizing I don’t really have a local environment for Wappler. I install Wappler on my windows machine and my project files are stored locally but then everything is uploaded to my web server and all php things are run there. It works fine and I don’t have a problem with working that way but now I see that it is probably not the right way to be working. So do you have advise for what I should do to install things like composer and the mpdf library. Do I do it at the server level? Or is the right question, how should I be using Wappler locally and how do I do that on Windows? Sorry, Wappler is so useful I don’t have to know all this other stuff but sometimes like this time, it does make me realize that I need to know more about the behind the scenes workings.
Any advice would be appreciated,
Rick

I have been working on PHP before Wappler, so I know a bit about it.
But with NodeJS, I am pretty much in the same boat as you - Wappler made it too easy for me, and then I had to learn things when I found myself in a bit complex situations.

I am not sure if composer can even work on a server directly. You would have to SSH into the server and install it there I assume.
But, what I would advise is to install WAMP/XAMP server for Windows and learn a bit about it from Youtube.
Its very simple and allows you to run your PHP applications locally, without having the publish anything to the remote server. You willl have to setup a local target in your Wappler project.

Hello,

It depends on your server, are you on linux or windows? is this a dedicated or shared server?

For my part, I am stuck on the html fields, what should I put in the HTML code of my page?

Yes. The HTML code which would render as a page and then get printed as PDF.

i can’t get it to work, could someone please share their files to me that i understand or it crashes

thanks in advance

Were you able to clone the Git repo and run that?

not run, i’ve one error 500 filed required

mandatory and missing fields, while the fields are filled

ok it’s good for git repo

Thats great. So you were able to get it to work.
I guess the newer post you have created is to setup the HTML for PDF.

There is a problem. The conversion uses chromium and those who have a server without graphics libraries will not be able to install any of this.

Yes you are right. There were several libraries on linux missing. Now they are all there. An error remains when I try to generate the pdf:

“Error: Failed to parse parameter value: undefinedmm\n at assert (/node/node_modules/puppeteer/lib/cjs/puppeteer/common/assert.js:26:15)\n at convertPrintParameterToInches (/node/node_modules/puppeteer/lib/cjs/puppeteer/common/Page.js:2526:32)\n at Page.createPDFStream (/node/node_modules/puppeteer/lib/cjs/puppeteer/common/Page.js:2067:27)\n at Page.pdf (/node/extensions/server_connect/modules/HtmlToPDF.js:83:16)\n at processTicksAndRejections (internal/process/task_queues.js:95:5)\n at async App._exec (/node/lib/core/app.js:487:30)\n at async App._exec (/node/lib/core/app.js:458:17)\n at async App.exec (/node/lib/core/app.js:427:9)\n at async App.define (/node/lib/core/app.js:417:9)”

ok, solved! After inserting the margins it generated the pdf. Thank you!

You are correct. I think its mentioned in the original post somehwere that this does not work on servers where you can’t install those additional libraries required by Puppeteer.

As for the margins issue, I’m sorry but I haven’t found time to update the extension. Wappler changed the way default/empty values are used some time ago, and I haven’t modified the repo to handle that.

There have been few other changes/improvements that I have discovered as well. Hope to update soon.

2 Likes

Hi guys,
I need to generate / save / email pdf from our app.
Just installed the puppeteer package.
My Node.js server is down with a black screen and some error.


Any idea or advice?
Many thanks

just found a solution sorry

We’ve integrated a client-side App Connect PDF Creator component in Wappler 6.3.0
Please check it and let us know what do you think: Using App Connect PDF Creator

Note that more options will be coming to it in the next updates!

1 Like