Could you please recommend any free PHP library to create PDF files?
I have a website for selling books made with HTML, PHP and CSS. After a customer selected some books (and have them in the cart), I’d like to generate a PDF quotation showing all selected books and the total.
I started reviewing the documentation of this product.
After making a test .php file with the first sample code and open it with a browser, I get a missing file warning message for dompdf-master/lib/php-font-lib/classes/Font.php, from dompdf-master/dompdf_config.inc.php on line 332.
if (DOMPDF_ENABLE_AUTOLOAD) {
require_once(DOMPDF_INC_DIR . “/autoload.inc.php”);
require_once(DOMPDF_LIB_DIR . “/php-font-lib/classes/Font.php”);
}
But when checking dompdf inner directories, within php-font-lib there is nothing, so the error message is right, there is no classes directory nor font.php file there.
Looking the whole dompdf directory, there is no classes directory nor font.pdf file at all.
Any idea of what am I doing wrong?
Thanks a lot!!!
In the meantime I was able to find the missing files.
I am now in testing process.
This is I’d like to do:
We have an online bookstore. The idea is after the customer selected the books and put them in the cart, to be able to generate a simple PDF quotation showing a quotation number, customer name and e-mail (requested in a previous page), selected books and the total.
Yes. It’s a library for generating a PDF from HTML markup and CSS styles (
I thought the SitePoint one I linked to was pretty basic.
I just followed it in 5 minutes and was able to get the basic example working with no problems.
I just followed it in 5 minutes and was able to get the basic example working with no problems.
I am feeling like a Neanderthal
I am still thinking like PHPMailer, where the idea is to build the final e-mail step by step with instructions.
What is the basic strategy with this library? I guess I have to build a webpage of what I want as a PDF outcome. I do not see any instruction to build the PDF step by step.
The first thing I would look at is whether your page is valid.
If you run it through the W3C validator you get 7 errors.
I would fix these first and see if it helps the situation.
I am reviewing the errors.
The first one is about “No Character Encoding Found”.
Researching, the suggested code for Latin America is ISO-8859-01. I have added it using two available instructions:
Without any character encoding instruction, website is working well. Why should I use one?
Also, can you see if the one I am trying to use is the right one and what am I doing wrong?
Without any character encoding instruction, website is working well. Why should I use one?
Before start modifying my website trying to fix errors, could you please confirm if this is the right character encoding for me to use? (for Spanish Latin America).