/    Sign up×
Community /Pin to ProfileBookmark

Need help with printing php page

We are building a dynamic site that will have user pages. One of the options we would like to offer, is to be able to print out a version of the page, like a flyer. So this template will pull the images, info, etc into the page, and either use the browser print button or have a print button on it.

What I would like though, is to convert it to pdf or img before printing so it doesn’t show the URL or page numbers. So they have a clean flyer they can hand out.

Is there a way to have a button, when clicked on it takes the page, pulls all the info in, converts it to pdf and then prints it out?

Thanks,

Richard

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@davidasmith90Jul 28.2011 — Hi Richard,

I have done something similar to this before and found a class called FPDF to be very helpful as it enables you to create PDF files through PHP. Although it was a bit of a pain to get the page contents in the exact positions that I wanted, once I was happy with the layout, the PHP class worked like a charm.

I've included a link to the class below (it's 100% free):

http://www.fpdf.org/

Hope this helps,

David
Copy linkTweet thisAlerts:
@davidasmith90Jul 28.2011 — Also, I'm not sure if it is possible to automatically set the PDF to print once loaded but if not, it would be fairly easy for the user to press the print button on their PDF software (most probably, Adobe Acrobat).
×

Success!

Help @rwrogers11 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.28,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...