Link to home
Start Free TrialLog in
Avatar of Joseph Longo
Joseph Longo

asked on

FPDF - Creating Multiple Pages via "Foreach" loop

Hello Experts,

I created a 19 question PHP survey program using HTML text areas. It is hosted on my employer's network and can only be accessed via a work computer. The results are anonymous, to some extent. Although I do not collect the survey taker's information, I work in a small department and my boss would know that it came from someone currently working at the moment. My department is open 24/7, 365. So, instead, my boss wants me to dynamically generate a PDF, upon the user's submission, which is not a huge ordeal...but...

How would I accommodate various users' responses, i.e., shorter responses versus longer responses? It'd be nice if each pdf was restricted to X pages, but I don't want to restrict the end user's answer.

Also, if the data extends beyond one page, how do I create additional pages? Would I just use another instance of $pdf->AddPage();?
ASKER CERTIFIED SOLUTION
Avatar of M. Tariq
M. Tariq
Flag of Oman image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Joseph Longo
Joseph Longo

ASKER

I was thinking about that. However, I don't want to limit the user. For instance, if I enforce each page to only contain 4 responses, then I would have to enforce the length of their response to each question. However, if the size and pages of the pdf could be created dynamically based on the length of the user's response that would be best. I want people to have the freedom to answer the questions as in-depth as they would like to.
Nevermind. My boss changed her mind on how she would like the data handled.
Thank you for your input.