Jump to content

[SOLVED] php and printer-friendly view/print functions


boo_lolly

Recommended Posts

first, is this best attempted using php or javascript? i'm sure there are many approaches. you could turn it into a pdf document and have them download it manually. or a .doc file sent to their desktop. or a simple click of the link will activate the default printer. what's the best approach? any advice?

Link to comment
Share on other sites

you might be able to do something like this:

 

Person loads your document you have a butotn on it that says print This! it goes to printhis.php?page=page1.php

 

then the printhtis.php takes the $_GET['page']; and runs file_get_contents on that path, returns the outputted xhtml,css and then using a ton of stuff formats it into a pdf and then the user can take that pdf to go.

 

If you are looking for a general solution its gonna be rough, if you have a constant temaplate you might have an easier go.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.