Printer functions

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Stefano

    Printer functions

    I've got a problem using printer functions with my network printer shared on
    another PC as \\192.168.1.3\H P

    If the printer is connected and reachable, printer_***() functions work
    correctly.

    Now let suppose the printer cable is unplagged so the printer is no more
    reachable:

    $handle = printer_open($p rinter_address) ; // Returns an handle also if the
    printer is unreachable (it is strange, it should return null)
    printer_start_d oc($handle, "My Document"); // Returns false. It is correct
    because the printer is unreachable.

    Now I reconnect the printer cable:

    $handle = printer_open($p rinter_address) ; // Returns the handle
    printer_start_d oc($handle, "My Document"); // RETURNS FALSE ALTHOUGHT THE
    PRINTER IS CONNECTED.

    At this point I cannot print anything using printer functions.
    I have to stop and restart Apache service to get TRUE from
    printer_start_d oc() and every thing works correctly again.

    Any idea ?

    Thanks for the help.

    Stefano


  • The Natural Philosopher

    #2
    Re: Printer functions

    Stefano wrote:
    I've got a problem using printer functions with my network printer shared on
    another PC as \\192.168.1.3\H P
    >
    If the printer is connected and reachable, printer_***() functions work
    correctly.
    >
    Now let suppose the printer cable is unplagged so the printer is no more
    reachable:
    >
    $handle = printer_open($p rinter_address) ; // Returns an handle also if the
    printer is unreachable (it is strange, it should return null)
    printer_start_d oc($handle, "My Document"); // Returns false. It is correct
    because the printer is unreachable.
    >
    Now I reconnect the printer cable:
    >
    $handle = printer_open($p rinter_address) ; // Returns the handle
    printer_start_d oc($handle, "My Document"); // RETURNS FALSE ALTHOUGHT THE
    PRINTER IS CONNECTED.
    >
    At this point I cannot print anything using printer functions.
    I have to stop and restart Apache service to get TRUE from
    printer_start_d oc() and every thing works correctly again.
    >
    Any idea ?
    >
    Thanks for the help.
    >
    Stefano
    >
    >
    What platform are you on here? windows or Linux, or something else?

    Comment

    • Stefano

      #3
      Re: Printer functions

      >>
      What platform are you on here? windows or Linux, or something else?
      >
      I was trying printer functions under windows ... since they work only under
      windows. I have also a Linux server available but that set of functions is
      not available, is there anything similar ?


      Comment

      • Jeff North

        #4
        Re: Printer functions

        On Sat, 16 Aug 2008 23:00:16 +0200, in comp.lang.php "Stefano"
        <aaa@aaa.it>
        <48a73ff0$0$416 57$4fafbaef@rea der4.news.tin.i twrote:
        >| I've got a problem using printer functions with my network printer shared on
        >| another PC as \\192.168.1.3\H P
        >|
        >| If the printer is connected and reachable, printer_***() functions work
        >| correctly.
        >|
        >| Now let suppose the printer cable is unplagged so the printer is no more
        >| reachable:
        >|
        >| $handle = printer_open($p rinter_address) ; // Returns an handle also if the
        >| printer is unreachable (it is strange, it should return null)
        >| printer_start_d oc($handle, "My Document"); // Returns false. It is correct
        >| because the printer is unreachable.
        >|
        >| Now I reconnect the printer cable:
        >|
        >| $handle = printer_open($p rinter_address) ; // Returns the handle
        >| printer_start_d oc($handle, "My Document"); // RETURNS FALSE ALTHOUGHT THE
        >| PRINTER IS CONNECTED.
        >|
        >| At this point I cannot print anything using printer functions.
        >| I have to stop and restart Apache service to get TRUE from
        >| printer_start_d oc() and every thing works correctly again.
        >|
        >| Any idea ?
        >|
        >| Thanks for the help.
        You say that you disconnect and reconnect the cable. Have you tried
        turning the printer off then on again?
        This could be the reason that the printer is still not responding.
        Have you tried printing a document, via word etc, to the same printer
        once you reconnect the cable? If this is not successful then it would
        indicate that the printer hasn't re-initialised the network
        connection.

        Comment

        • The Natural Philosopher

          #5
          Re: Printer functions

          Stefano wrote:
          >What platform are you on here? windows or Linux, or something else?
          >>
          >
          I was trying printer functions under windows ... since they work only under
          windows. I have also a Linux server available but that set of functions is
          not available, is there anything similar ?
          >
          >
          SAure. Under linux you talk to a printer susbsytem, which talks to
          either local or remote printer.

          Google CUPS for how to set the whole thing up.


          Not sure how its invoked from php though..probabl y by exec-ing lp..

          Comment

          Working...