Skip to content

Commit

Permalink
PPD generator for driverless printers: add "*LandscapeOrientation:"
Browse files Browse the repository at this point in the history
In the generated PPD files add the keyword "*LandscapeOrientation:"
with the values "Plus90" or "Minus90" according to the
landscape-orientation-requested-preferred printer IPP attribute with
values "4" and "5" resp.
  • Loading branch information
tillkamppeter committed Apr 7, 2023
1 parent 1934a6c commit 64499ae
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions ppd/ppd-generator.c
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,16 @@ ppdCreatePPDFromIPP2(char *buffer, // I - Filename buffer
else
cupsFilePuts(fp, "*ColorDevice: False\n");

if ((attr = ippFindAttribute(response,
"landscape-orientation-requested-preferred",
IPP_TAG_ZERO)) != NULL)
{
if (ippGetInteger(attr, 0) == 4)
cupsFilePuts(fp, "*LandscapeOrientation: Plus90\n");
else if (ippGetInteger(attr, 0) == 5)
cupsFilePuts(fp, "*LandscapeOrientation: Minus90\n");
}

cupsFilePrintf(fp, "*cupsVersion: %d.%d\n", CUPS_VERSION_MAJOR,
CUPS_VERSION_MINOR);
cupsFilePuts(fp, "*cupsSNMPSupplies: False\n");
Expand Down

0 comments on commit 64499ae

Please sign in to comment.