NYCPHP Meetup

NYPHP.org

[nycphp-talk] Re: Automatically Print Pages

Joseph Crawford codebowl at gmail.com
Wed Dec 20 16:50:25 EST 2006


THe current situation is this.

We use PHP for the warehouse tools section of the site.  THe tools are
hosted on a server at Rackspace that is also connected via VPN to our local
network.  We are trying to figure out how to do one of 2 things.

1.) have the files print locally on the workstations (Windows XP, IE).  We
actually thought of the batch file but that would cause ALL PDF to be sent
to the batch file and we wouldnt want that.
2.) Have the server at rackspace send the lpr command to push the file to
the shared printer using lpr.

#2 is the way i am thinking of going.  On the form there would be a textbox
that says Printer Name, they would scan a barcode that would inject the
printers shared name.  lpr would send the command to that shared printer.

The question is how do i know if the linux server at rackspace is actually
seeing the shared printers in-house here.

Thanks,
Joseph Crawford

On 12/20/06, Rolan Yang <rolan at omnistep.com> wrote:
>
> What operating system and web client are you using? I did something like
> this a few months ago. Opened the content in a separate hidden window
> then used javacript "window.Print" then closed the window after it was
> done. It's not completely reliable. If I remember correctly, it worked
> with some versions of IE (circumventing the printer dialog box), but not
> Firefox or Opera browser.
>
> I think what we ended up doing was (and this is on a windows system),
> creating a unique mime type and configuring windows and the browser to
> run a batch file. When that mime type was detected, a  batch file was
> run which copied the downloaded file to lpt1. Essentially dumping the
> contents to the printer. You could probably use the DOS commant line
> "print /d:LPT1: c:\temp\temporary file" to do the same.
> This will work if you are dumping something like raw data to a label
> printer.
>
> Other odd situations arose also. On some machines, the default mime type
> stuck after the initial selection and we were not able to change it
> back. It's been a while so I don't remember all the problems, but at
> least you have a general idea in which direction to travel now.
>
> Good luck,
> Rolan
>
> Felix Shnir wrote:
> > This isn't possible with plain vanilla JS.  You'd need to look into
> > ActiveX controls, even then it might not be possible...
> >
> > Felix.
> >
> >
> > On 12/20/06, * Joseph Crawford* <codebowl at gmail.com
> > <mailto:codebowl at gmail.com>> wrote:
> >
> >     Ok so i misunderstood the actual requirement.
> >
> >     THe page would have to print on the client machine as there are
> >     many machines running the scan guns.  I am assuming i would need
> >     Javascript for this task but i am not sure if there are any
> >     libraries out there for this already.
> >
> >     We would want to print the page to the default printer completely
> >     bypassing the print dialog that pops up.
> >
> >     Any assistance will be appreciated.
> >
> >     Thanks,
> >     Joseph Crawford
> >
> >
> >     On 12/20/06, *Joseph Crawford* <codebowl at gmail.com
> >     <mailto:codebowl at gmail.com>> wrote:
> >
> >         Ok Guys & Gals,
> >
> >         I know i have seen talk on this subject before (or similar)
> >         but i never had a use for it until now.
> >
> >         My fulltime employer has their warehouse application written
> >         in PHP controlled with scan guns, etc.
> >         When they pack an order they scan the barcodes and it
> >         processes the order.  The script then generates a PDF and
> >         currently redirects to the PDF so that it will
> >         open in the browser.  They can then hit print to print the page.
> >
> >         We would like to streamline this a bit more.  Rather than
> >         redirect to the PDF we would like the PHP script actually send
> >         the PDF directly to the printer.  I know you can
> >         do this as i recall someone doing it with a DYNAMO labeler.
> >
> >         The question is where can i read up on this topic.  We would
> >         need to send this off to the default printer port.
> >
> >         Any insight would be a great help.
> >
> >         Thanks,
> >         --
> >         Joseph Crawford Jr.
> >         Zend Certified Engineer
> >         Codebowl Solutions, Inc.
> >         http://www.codebowl.com/
> >         Blog: http://www.josephcrawford.com/
> >         1-802-671-2021
> >         codebowl at gmail.com <mailto:codebowl at gmail.com>
> >
> >
> >
> >
> >     --
> >     Joseph Crawford Jr.
> >     Zend Certified Engineer
> >     Codebowl Solutions, Inc.
> >     http://www.codebowl.com/
> >     Blog: http://www.josephcrawford.com/
> >     1-802-671-2021
> >     codebowl at gmail.com <mailto:codebowl at gmail.com>
> >
> >     _______________________________________________
> >     New York PHP Community Talk Mailing List
> >     http://lists.nyphp.org/mailman/listinfo/talk
> >
> >     NYPHPCon 2006 Presentations Online
> >     http://www.nyphpcon.com <http://www.nyphpcon.com>
> >
> >     Show Your Participation in New York PHP
> >     http://www.nyphp.org/show_participation.php
> >     <http://www.nyphp.org/show_participation.php>
> >
> >
> >
> >
> > --
> > Felix
> > -------------------------
> > God put me on earth to accomplish a certain number of things.  Right
> > now, I'm so far behind, I will never die...
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > New York PHP Community Talk Mailing List
> > http://lists.nyphp.org/mailman/listinfo/talk
> >
> > NYPHPCon 2006 Presentations Online
> > http://www.nyphpcon.com
> >
> > Show Your Participation in New York PHP
> > http://www.nyphp.org/show_participation.php
> _______________________________________________
> New York PHP Community Talk Mailing List
> http://lists.nyphp.org/mailman/listinfo/talk
>
> NYPHPCon 2006 Presentations Online
> http://www.nyphpcon.com
>
> Show Your Participation in New York PHP
> http://www.nyphp.org/show_participation.php
>



-- 
Joseph Crawford Jr.
Zend Certified Engineer
Codebowl Solutions, Inc.
http://www.codebowl.com/
Blog: http://www.josephcrawford.com/
1-802-671-2021
codebowl at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20061220/2c8d1f6d/attachment.html>


More information about the talk mailing list