Convert an HTML / BOOSTRAP / PHP output to PDF

Hi, I am new to web development. I have a report (invoice) created in a blank with boostrap, php and html. I have created another Blank that executes the first blank sending the invoice to print. My idea is to take that output and convert it to PDF. I found in a video the use of the “wkhtmltopdf” program which is part of scriptcase and is supposed to allow it to be done. The truth is that I could not generate the PDF (it does not work for me and I do not know why.
My code is:
$ invoiceId = 51;
$ wkhtmltopdf = “C: / Users / ruben / Program Files / NetMake / v9-php73 / wwwroot / scriptcase / prod / third / wkhtmltopdf / win / wkhtmltopdf”;
$ application = “http://127.0.0.1:8091/scriptcase/app/tempus/blank_factura/index.php?facturaId=”.$facturaId;
$ invoice = “C: / Program Files / NetMake / v9-php73 / wwwroot / scriptcase / tmp / invoice _”. $ invoiceId. “. pdf”;
$ run = $ wkhtmltopdf. ’ ‘. $ application.’ '. $ invoice;

echo “wkhtmltopdf INFORMATION:”. $ wkhtmltopdf. “
”;
echo “application INFORMATION:”. $ application. “
”;
echo “INFO invoice:”. $ invoice. “
”;
echo “INFORMATION execution:”. $ execute. “
”;
$ exe = shell_exec ($ execute);

// Take the file and display it
header (‘Location:’. $ invoice);

If I run it through CMD it sends me the following message:
“It is not recognized as an internal or external command, program, or executable batch file.”

I found videos on the internet about the message and I can’t get it to execute.

TBH, I have never tried this construction. But It’s quite easy to generate a pdf. Have you considered creating a pdf directly?

Hi,
I think there are many more advantages to using an html, you can make the background designs and take advantage of the language changes (today it forces you to have an image for each language), that also applies to regional formats. Scriptcase should have a macro to facilitate the conversion. If you think about it, they currently have to be doing it.

Well, I’m not going to argue about that. Thing is, that you can do a lot in HTML that is not supported by PDF and visa-versa. So even if SC would implement something like that, it always will be some kind of subset of HTML. But SC is making use of tcpdf and the tcpdf library support HTML functions. See Example 061 : XHTML + CSS · TCPDF
Perhaps that’s useful?

I review it
Thanks for support.