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?

  • Instead could you ask cups to send the job for you? eg perl net-cups. – meuh Aug 27 '19 at 9:37
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.

  • 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 Aug 30 '19 at 7:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.