I have a webform that sends data to a perl script that then creates a PDF document before sending it off by email to someone.
I need to print out some of these PDF Documents. At the mo i’m finding, opening and then printing manually. Simple and straight forward process.
However it would be great if it was printed automatically as required. One in four require printing and i occasionally forget causing problems later on!
The perl script can establish which do and don’t need printing.
What would be the best way to achieve this?
Add the Perl NET:: Printer module
Add Bash code to print the document to the printer.
Yast (openSUSE 15 Leap) fails to find the perl-net-printer module, how do i install this module?
Hi
You would need to configure and use cpan on your system as there is no perl-net-printer available for Leap (and Tumbleweed it’s in the CPAN staging repository, not in the release).
I sucessfully installed the NET:: Printer module after resolving a few issues along the way and when i print a PDF document (from within a perl script) to the printer i just get a blank sheet of paper!!
So i thought i would try the NET::CUPS:: Destination Module instead…
Stumped, the module attempts install and fails with a message saying cups/cups.h is missing… #include <cups/cups.h>. The file is missing, compilation terminated.
libcups2 is installed, i can’t find cups.h anywhere on the system.
I can open a PDF Document and print it to the HP Network Printer OK, it’s a CP2025n at the IP address 10.1.1.25 port 9100.
Where am i going wrong?
Should i try removing libcups2 and then re-installing it? whereis libcups returns libcups:
I have given up on getting cpan’s NET:: Printer module to print files to a local network printer.
I have however managed to get a PDF document sent to the printer and printed out from a perl script by invoking a shell command instead.
Given that the webform and the perl script is UserName and PassWord protected on a secure web server and things are setup in a way that these specific files are only accessible from specific devices with static ip addresses on the local network only. They are not accessible via the WAN. I’ve decided this is a controlled and accepteable risk to take.