Link to home
Start Free TrialLog in
Avatar of Fred D
Fred DFlag for United States of America

asked on

Automated PHP Routine to print Membership Cards with Background

We tried to come up with a PHP routine to automatically print our membership cards that we send out to several thousand members but the background will not print unless we tell each user to modify their individual browser's printer properties to include background printing.  The member's variable information that comes from our database looks and prints okay but the background image is missing when they go to print.
This is a pain especially for those that are not as computer literate.  Is there a way to force their browsers to print the background image?  
Our PHP routine is attached.
Thank you.
MembershipCardPrintRoutine.txt
Avatar of Chris Stanyon
Chris Stanyon
Flag of United Kingdom of Great Britain and Northern Ireland image

You might be better of serving up a PDF of the membership card and asking them to print that. Just a thought :)
I agree - PDF is the better way to go. It is a better, more consistent format for printing. Background images will always print and you'll have a consistent experience across all computers.

You can use a class like TCPDF to generate a PDF from PHP and then simply send it to the user via browser download.
Avatar of Fred D

ASKER

I actually was considering using a PDF but didn't know how to create one on the fly in a PHP script.
Please elaborate on the TCPDF.
Thank you.
ASKER CERTIFIED SOLUTION
Avatar of gr8gonzo
gr8gonzo
Flag of United States of America 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