4

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?

2
  • Instead could you ask cups to send the job for you? eg perl net-cups.
    – meuh
    Commented Aug 27, 2019 at 9:37
  • It seems that the question is misleading - Net::Printer sends to an 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 )
    – le_top
    Commented Mar 28, 2021 at 22:07

1 Answer 1

1
+50

Unless the setting could be changed elsewhere, I might try changing line 28 of the Zebra PPD file from *LandscapeOrientation: Plus90 to *LandscapeOrientation: Plus0.

1
  • That might make sense, but would require tinkering with print server configuration, which cannot be done easily (ancient way of configuring printers). I may try forcing it on this one printer and see how it would react. Thanks!
    – Bart
    Commented Aug 30, 2019 at 7:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .