in reply to Re: NET::Printer Module not printing to local printer
in thread NET::Printer Module not printing to local printer

Thank you holli for your reply

running the command lpstat -a returns the following result

lpstat -a HP_Color_LaserJet_CP2025n accepting requests since Wed 10 Apr 2019 22:05:32 BST

running the command lp -d HP_Color_LaserJet_CP2025n "Test Sheet.txt" request id is HP_Color_LaserJet_CP2025n-8 (1 file(s))

Prints out the txt file OK, printing a PDF document in the same way works too.

Am i a module missing and or do i need to add info the the script so that the print command knows where to find the printer?

Do i need to install, setup and or configure something elsewhere?

Changing the $PrinterName = " HP Network Printer" to $PrinterName = "HP_Color_LaserJet_CP2025n" doesn't fix the problem

is lp installed on the webserver? Tried googling this one and got nowhere, can i ask what's meant by this with a little more info so i can explore further

  • Comment on Re^2: NET::Printer Module not printing to local printer

Replies are listed 'Best First'.
Re^3: NET::Printer Module not printing to local printer
by holli (Abbot) on May 02, 2019 at 08:51 UTC
    running the command lp -d HP_Color_LaserJet_CP2025n "Test Sheet.txt" request id is HP_Color_LaserJet_CP2025n-8 (1 file(s))
    On which machine did you run that? I'm thinking, if the module uses lp and lp is not installed on the webserver (and why should it, it's a webserver) that could be why it doesn't work. And so if you ran that command from your dev machine it doesn't tell us much.


    holli

    You can lead your users to water, but alas, you cannot drown them.

      Sorry i was specifically thinking that you were sugesting that the the webserver apache required configuring in some way. On this linux box there is more than one server running, ftpd, apache, smb and others.

      The lp command was issued on the same limux box that the webserver is on

      all other boxes on the network are running Win7

      The code below inserted into the perl script works: system("lp -d HP_Color_LaserJet_CP2025n /path/to/filename.pdf");

      sucessfully and prints the test file, but is creates the problem that i don't get returned the perl script afterwards, not explored why yet, i'll look into this a later on today.

      I may have to abandom the NET::Printer module and explore exporting the print process to a shell command instead. It works, just need a little more thought and work to get back to the perl script without crashing it