Context
This project is for an invoice application that generates a pdf from a button click. Its plain and simple, approched with the MVP concept. Over time, I did add a few details but they do not interfere with the PDF generation.
My Tool Belt
The tools I’ve used for R&D are:
- M1 with Sonoma 14.3.1,
- Visual Studio Code Version: 1.89.1 (Universal),
- Latest PHP version (8.2),
- FPDF (1.86),
- Latest MySQL (8.X),
- Brave, FireFox and Safari (Latest Version),
- Perplexity AI (GPT 3.5)
Problem
In the latest FPDF version, I want to change the words thats coming from a MySQL database to be bigger in size AND displayed in the same CELL. This means displaying the following:
<?php
include('PATH/TO/FPDF');
class PDF extends FPDF
{
function Info($data) {
$this->Cell(190, 5, "NAME: " . $data['name'], "B", 0, "L");
}
}
?>
where the name
column (from MySQL), should be bigger in font size than "NAME: "
in the output.
What I Tried
I’ve used the following methods (from FPDF), with no success:
- MultiCell
- SetFont
- GetY
- GetX
- Ln
- SetFontSize
- SetX
- SetY
- SetXY
- Write
Yes, I did look on StackOverFlow and Googled it, and as similar as the titles are to solving my problem, they do not provide the actual solution. I also verfied just now if there are any answers out there to answer my question as my last chance. There are none 🙁 . I need to make the data from MySQL bigger like in the PDF from Acrobat where you’re filling out a form. Imagine filling out a PDF form for the goverment or scholarships, they make the user inputs bigger that the hard-coded string.
The mentioned methods used were also the ones I’ve implemented to solve this problem. I’ve used many more methods that aren’t mentioned, and they obviously lead to nowhere.
What I Got
I am currently stuck on the Cell method and from researching article, youtube videos and blog posts, have gotten no where near to my goal.
Quick Review
Heres the documentation:
- FPDF Official Documentation
Looped Cheese is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.