I've got a script that creates a PDF and sends it to remote print server running CUPS.
Using Net::Printer
, I set up the printer:
my $print_server = "remote_print.server";
my $printer = "lp1234";
my $lineprinter = new Net::Printer(
filename => $pdf,
printer => $printer,
server => $print_server,
port => 515
);
[...]
# Print and get printer stauts.
$result = $lineprinter->printfile();
The remote printer is a label printer, Zebra ZT420, configured with Zebra PPD.
Now, the problem is that the printed label is forced somehow, somewhere on the way, to vertical orientation, instead of horizontal one, no matter how I set up the PDF file (be it force it to be vertical or horizontal).
When printing manually, e.g. using Document Viewer on GNOME, or system Print Dialog, the output is printed correctly.
Why does it happen with my code?
What did I miss or misconfigure?
Is there a way to force orientation when sending it to a printer?
lpd
server and port 515 is a port for that, if it were sending to cups, it should have been port 631 . (See metacpan.org/pod/Net::Printer )