NYCPHP Meetup

NYPHP.org

[nycphp-talk] batch print

Jon Baer jonbaer at jonbaer.net
Fri Jul 4 00:40:14 EDT 2003


very nice ... was it using PDFlib or doing it on it's own?  in any case, here is a snippet for mixing javascript/php for printing ...

- jon

<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
   <!--
   var VBS = false;
   // -->
  </SCRIPT>
  
  <script language="VBScript">
   sub window_onunload
    on error resume next
    set WB = nothing
   end sub
   
   function printIt
    ' on error resume next
    
    call WB.ExecWB(6,1)
    '6,2 gives no alert
    
    if err.number <> 0 then
     if DA then ' Internet Explorer 4 they probably cancelled
      alert "Nothing Printed :" & err.number & " : " & err.description
     else
      handle_error '  ie3x give alternate instructions
     end if
    end if
   end function
   
   document.write  "<OBJECT ID=""WB"" WIDTH=0 HEIGHT=0 CLASSID=""CLSID:8856F961-340A-11D0-A96B-00C04FD705A2""> </OBJECT>"
   
   VBS = true
   
  </script>
  
  <SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
   <!--
   
   /* The actual print function */
   
   function printArticle()
   {
    if (window.print) window.print();
    else if (VBS) printIt();
    else alert('Error: Your browser can not print :-(');
   }
   
   // -->
  </SCRIPT>
 </head>
     
 <body onload="printArticle();" bgcolor="#FFFFFF">
  
  <style type="text/css">
   <!--
   .text {
    color: #000000;
    font-family: arial,verdana;
    font-size: 12px;
   }
   //-->
  </style>
  
  <center>
  
  <table border="0" cellspacing="0" cellpadding="0" width="80%">
    <tr><td valign="top">
      <span class="text">
  
      <img src="../images/header/blm_logo.gif"><br/><br/>
       
  <script language="php">
   if ($issue == "200302") {
  </script>

stuff to print

<script language="php">
}
</script>

pgp key: http://www.jonbaer.net/jonbaer.asc
fingerprint: F438 A47E C45E 8B27 F68C 1F9B 41DB DB8B 9A0C AF47


  ----- Original Message ----- 
  From: Tim Toomey 
  To: NYPHP Talk 
  Sent: Thursday, July 03, 2003 3:01 PM
  Subject: Re: [nycphp-talk] batch print


  I was kind of looking for both, I eventually found a contribution that made database entries into .pdf files so I could batch print so I cheated a bit. :)

  -timmy
    ----- Original Message ----- 
    From: Jon Baer 
    To: NYPHP Talk 
    Sent: Thursday, July 03, 2003 7:21 PM
    Subject: Re: [nycphp-talk] batch print


    are u looking for the bit of code to send data to print or what the sql would be?

    - jon

    pgp key: http://www.jonbaer.net/jonbaer.asc
    fingerprint: F438 A47E C45E 8B27 F68C 1F9B 41DB DB8B 9A0C AF47


      ----- Original Message ----- 
      From: Tim Toomey 
      To: talk at lists.nyphp.org 
      Sent: Thursday, July 03, 2003 9:02 AM
      Subject: [nycphp-talk] batch print


      Is it possible to batch print an entire mysql table in detailed view with php?

      My work wants to be able to batch print the entire day's orders with a few clicks (in the detailed invoice view) and I don't think I can do it without getting all the invoices forwarded individually to say outlook and then have them batch printed there.

      thanks,

      -timmy


--------------------------------------------------------------------------


      _______________________________________________
      talk mailing list
      talk at lists.nyphp.org
      http://lists.nyphp.org/mailman/listinfo/talk



----------------------------------------------------------------------------


    _______________________________________________
    talk mailing list
    talk at lists.nyphp.org
    http://lists.nyphp.org/mailman/listinfo/talk



------------------------------------------------------------------------------


  _______________________________________________
  talk mailing list
  talk at lists.nyphp.org
  http://lists.nyphp.org/mailman/listinfo/talk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20030703/f2ae9a3f/attachment.html>


More information about the talk mailing list