Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #1907

Re: Print preview in php

From Robert Heller <heller@deepsoft.com>
Organization Deepwoods Software
Subject Re: Print preview in php
References <fb8ba0bb-310a-4470-b63d-3f9d353468c8@gu8g2000vbb.googlegroups.com> <irpism$jhp$1@dont-email.me> <xJidnWeLWcSY_33QnZ2dnUVZ_gOdnZ2d@posted.localnet> <78c83f9f-5257-4a22-8475-1fc3af9eeb73@gc3g2000vbb.googlegroups.com>
Newsgroups comp.lang.php
Message-ID <4MSdnd1vaeA8aX3QnZ2dnUVZ_jqdnZ2d@posted.localnet> (permalink)
Date 2011-05-28 08:12 -0500

Show all headers | View raw


At Sat, 28 May 2011 02:05:04 -0700 (PDT) Co <vonclausowitz@gmail.com> wrote:

> 
> On 28 mei, 04:46, Robert Heller <hel...@deepsoft.com> wrote:
> > At Fri, 27 May 2011 21:24:36 -0400 Jerry Stuckle <jstuck...@attglobal.net=
> > wrote:
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > > On 5/27/2011 5:48 PM, Co wrote:
> > > > Hi All,
> >
> > > > 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?
> >
> > > > Regards
> > > > Marco
> >
> > > =A0From a web page? =A0Not possible. =A0PHP runs on the server and has =
> nothing
> > > to do with page layout (that's HTML/CSS). =A0Print preview runs on the
> > > client and is dependent on client settings, of which PHP has no knowled=
> ge.
> >
> > 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=3D"/ServeThePrinterFriendlyPage.php?..." target=3D"_blank"
> > onclick=3D"window.open(this.href,'win2','status=3Dno,toolbar=3Dno,scrollb=
> ars=3Dyes,titlebar=3Dno,menubar=3Dno,resizable=3Dyes,width=3D640,height=3D4=
> 80,directories=3Dno,location=3Dno');
> > return false;" rel=3D"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. =A0The
> > target=3D"_blank" attribute handles the case where JavaScript is not
> > available and the onclick attribute handles the case where JavaScript
> > is available. =A0On the page served, you need to include a link like:
> >
> > <a href=3D"#" onclick=3D"window.print();return false;">Print</a> and
> > optionally one like <a href=3D"#" onclick=3D"window.close();return
> > false;">Close</a>. The first is a button to print the page and the
> > second is a button to close the popup window.
> >
> >
> >
> > --
> > Robert Heller =A0 =A0 =A0 =A0 =A0 =A0 -- 978-544-6933 / hel...@deepsoft.c=
> om
> > Deepwoods Software =A0 =A0 =A0 =A0--http://www.deepsoft.com/
> > () =A0ascii ribbon campaign -- against html e-mail
> > /\ =A0www.asciiribbon.org=A0 -- against proprietary attachments
> 
> what should there be in the ServeThePrinterFriendlyPage.php?
> Is that the same as in the normal page but without images etc?

Yes.  Probably also without stuff like sidebars, menus, and extanious
navigation features -- just the basic printable content.

> 
> Marco
>     

-- 
Robert Heller             -- 978-544-6933 / heller@deepsoft.com
Deepwoods Software        -- http://www.deepsoft.com/
()  ascii ribbon campaign -- against html e-mail
/\  www.asciiribbon.org   -- against proprietary attachments


                                                                                    

Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


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