Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.php > #1894
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!news.weisnix.org!newsfeed.ision.net!newsfeed2.easynews.net!ision!newsfeed.arcor.de!newsspool4.arcor-online.net!news.arcor.de.POSTED!not-for-mail |
|---|---|
| Content-Type | text/plain; charset="UTF-8" |
| Message-Id | <16543329.4csPzL39Zc@PointedEars.de> |
| From | Thomas 'PointedEars' Lahn <PointedEars@web.de> |
| Reply-To | Thomas 'PointedEars' Lahn <php@PointedEars.de> |
| Organization | PointedEars Software (PES) |
| Date | Sat, 28 May 2011 13:33:47 +0200 |
| User-Agent | KNode/4.4.7 |
| Content-Transfer-Encoding | 8Bit |
| Subject | Re: Print preview in php |
| Newsgroups | comp.lang.php |
| References | <fb8ba0bb-310a-4470-b63d-3f9d353468c8@gu8g2000vbb.googlegroups.com> <irpism$jhp$1@dont-email.me> <xJidnWeLWcSY_33QnZ2dnUVZ_gOdnZ2d@posted.localnet> |
| Followup-To | comp.lang.php |
| MIME-Version | 1.0 |
| Lines | 46 |
| NNTP-Posting-Date | 28 May 2011 13:33:48 CEST |
| NNTP-Posting-Host | 65bb72f1.newsspool1.arcor-online.net |
| X-Trace | DXC=j6NIW[W1>X7TQL:hoD@>T?ic==]BZ:af>4Fo<]lROoR1<`=YMgDjhg2FOWAN8gE0O4DZm8W4\YJN<T<8F<]0D<`9OHL5R?BMCl>Po4kZOnGV>0 |
| X-Complaints-To | usenet-abuse@arcor.de |
| Xref | x330-a1.tempe.blueboxinc.net comp.lang.php:1894 |
Followups directed to: comp.lang.php
Show key headers only | View raw
Robert Heller wrote: > Jerry Stuckle wrote: >> On 5/27/2011 5:48 PM, Co wrote: >> > I was wondering if someone can help me with a code to preview part of >> > a php page >> > and eventually print it. >> > I don't want to print all of the page with images etc, just the data >> > within a certain area of the page. >> > >> > Anyone know if this is possible? >> >> From a web page? Not possible. PHP runs on the server and has nothing >> to do with page layout (that's HTML/CSS). Print preview runs on the >> client and is dependent on client settings, of which PHP has no >> knowledge. > > OTOH, if the web page in question is being served by the PHP code, all > you need to do is create a link, something like this: > > <a href="/ServeThePrinterFriendlyPage.php?..." target="_blank" > onclick="window.open(this.href,'win2','status=no,toolbar=no,[…]'); > return false;" You really want to avoid such spaghetti code. > rel="nofollow">Print This</a> > > And then the ServeThePrinterFriendlyPage.php file would then serve the > page without the special effects that make sense on the screen (eg > images, flash, ads, etc.) but don't on the printer. [complicated > regeneration of the current resource, probably with lots of hardly > maintainable ifs in-between] Or you could much more simply define a stylesheet for print media that does the necessary adjustments: <link rel="stylesheet" media="print" href="print.css"> PointedEars -- Prototype.js was written by people who don't know javascript for people who don't know javascript. People who don't know javascript are not the best source of advice on designing systems that use javascript. -- Richard Cornford, cljs, <f806at$ail$1$8300dec7@news.demon.co.uk>
Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Print preview in php Co <vonclausowitz@gmail.com> - 2011-05-27 14:48 -0700
Re: Print preview in php The Natural Philosopher <tnp@invalid.invalid> - 2011-05-28 01:33 +0100
Re: Print preview in php Jerry Stuckle <jstucklex@attglobal.net> - 2011-05-27 21:24 -0400
Re: Print preview in php Robert Heller <heller@deepsoft.com> - 2011-05-27 21:46 -0500
Re: Print preview in php Co <vonclausowitz@gmail.com> - 2011-05-28 02:05 -0700
Re: Print preview in php Robert Heller <heller@deepsoft.com> - 2011-05-28 08:12 -0500
Re: Print preview in php Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2011-05-28 17:30 +0200
Re: Print preview in php Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2011-05-28 13:33 +0200
Re: Print preview in php Co <vonclausowitz@gmail.com> - 2011-05-28 05:04 -0700
Re: Print preview in php TK <tknospa@wejuggle2.com> - 2011-05-28 07:22 -0500
Re: Print preview in php dougatmilmacdotcom@example.com (Doug Miller) - 2011-05-28 14:14 +0000
Re: Print preview in php Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2011-05-28 17:27 +0200
Re: Print preview in php TK <tknospa@wejuggle2.com> - 2011-05-28 12:20 -0500
Re: Print preview in php Jerry Stuckle <jstucklex@attglobal.net> - 2011-05-28 14:07 -0400
Re: Print preview in php Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2011-05-28 20:27 +0200
Re: Print preview in php TK <tknospa@wejuggle2.com> - 2011-05-28 15:18 -0500
Re: Print preview in php TK <tknospa@wejuggle2.com> - 2011-05-30 07:32 -0500
Re: Print preview in php Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2011-05-30 18:58 +0200
Re: Print preview in php TK <tknospa@wejuggle2.com> - 2011-05-31 07:34 -0500
Re: Print preview in php Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2011-05-31 15:08 +0200
Re: Print preview in php Jerry Stuckle <jstucklex@attglobal.net> - 2011-05-28 09:06 -0400
csiph-web