Hi guys, I haven’t used Composer before and I haven’t used the Terminal either. My aim is to use TCPDF (or HTML2PDF) but I am not comfortable with Terminal or Composer and need some very clear guidance.
I know a few of you have managed to get TCPDF up and running but because it must now be installed through Composer, I feel a bit out of my depth. I have used TCPDF (and HTML2PDF) in previous php projects, but that was a few years ago when you simply downloaded the library files, and before I found out about Wappler.
Can someone help with clear instructions on how to install and setup Composer (using Terminal?) and then install and setup TCPDF or HTML2PDF (they are basically the same thing)?
I really need to get this up and running today. Thanks.
That would really help. As I say, I am getting nowhere fast and need some guidance. I was trying to get a working sample to my client by this evening but that’s not going to happen now. Unfortunately no-one else has come forward with any help and so I would appreciate anything you can do, whenever you can do it.
Hi @sid , I managed to install composer and HTML2PDF last night and I managed to create a basic PDF.
Now for the fun part.
I have tried to do a dynamic PDF but it doesn’t seem to like anything outside of the “page” tag. How can I get it to accept any of the App Connect stuff or Stylesheets?
Hi. I assume you are using spipu/html2pdf library here.
In my use case, I just have PDFs to modify. I do not generate any new PDFs. So I am using TCPDF only.
A quick browse through the documentation suggests that you will have to send the HTML for which you need to generate the PDF.
In case of Wappler, I assume you would like to render something that is on the page (a particular section, sections or complete page), on click of a button.
If this is the case, you need to do two things:
Find some JS which will convert the section/page to a “clean” HTML - meaning all CSS & HTML should be in the string at once.
On click of the button, send that string to a PHP page, where you will pass the input to HTML2PDF object to generate PDF.