← Back to team overview

openjdk team mailing list archive

[Bug 1985042] [NEW] UnixPrintJob does not support collation

 

Public bug reported:

(Redirected here from https://github.com/adoptium/adoptium-
support/issues/559)

(I tried with Java 11, but I see the code hasn't changed in 17.)

Working under Linux (Xubuntu 22.04) here, so CUPS is the printing
system.

When doing:

HashPrintRequestAttributeSet printRequestAttributes = new HashPrintRequestAttributeSet();
printRequestAttributes.add(new Copies(2));
if (selectedPrintService.isAttributeCategorySupported(SheetCollate.class)) {
    printRequestAttributes.add(SheetCollate.COLLATED); // ignored...
}

DocPrintJob printJob = selectedPrintService.createPrintJob();
printJob.print(printDocument, printRequestAttributes);

the .add(SheetCollate.COLLATED) line is completely ignored.

I think the problem is that the underlying lpr command does not get the
-o collate=true option.

And I think this is due to UnixPrintJob.print() not implementing that
option, while it should be an easy one.

P.s.: as a workaround, one could add a default option to the printer via
lpoptions - still, I think it's a bug / missing feature in JDK.

ProblemType: Bug
DistroRelease: Ubuntu 22.04
Package: openjdk-11-jdk 11.0.16+8-0ubuntu1~22.04
ProcVersionSignature: Ubuntu 5.15.0-43.46-generic 5.15.39
Uname: Linux 5.15.0-43-generic x86_64
ApportVersion: 2.20.11-0ubuntu82.1
Architecture: amd64
CasperMD5CheckResult: pass
CurrentDesktop: XFCE
Date: Thu Aug 11 08:39:03 2022
InstallationDate: Installed on 2022-04-23 (109 days ago)
InstallationMedia: Xubuntu 22.04 LTS "Jammy Jellyfish" - Release amd64 (20220419)
RebootRequiredPkgs: Error: path contained symlinks.
SourcePackage: openjdk-lts
UpgradeStatus: No upgrade log present (probably fresh install)

** Affects: openjdk-lts (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: amd64 apport-bug jammy third-party-packages

-- 
You received this bug notification because you are a member of OpenJDK,
which is subscribed to openjdk-lts in Ubuntu.
https://bugs.launchpad.net/bugs/1985042

Title:
  UnixPrintJob does not support collation

Status in openjdk-lts package in Ubuntu:
  New

Bug description:
  (Redirected here from https://github.com/adoptium/adoptium-
  support/issues/559)

  (I tried with Java 11, but I see the code hasn't changed in 17.)

  Working under Linux (Xubuntu 22.04) here, so CUPS is the printing
  system.

  When doing:

  HashPrintRequestAttributeSet printRequestAttributes = new HashPrintRequestAttributeSet();
  printRequestAttributes.add(new Copies(2));
  if (selectedPrintService.isAttributeCategorySupported(SheetCollate.class)) {
      printRequestAttributes.add(SheetCollate.COLLATED); // ignored...
  }

  DocPrintJob printJob = selectedPrintService.createPrintJob();
  printJob.print(printDocument, printRequestAttributes);

  the .add(SheetCollate.COLLATED) line is completely ignored.

  I think the problem is that the underlying lpr command does not get
  the -o collate=true option.

  And I think this is due to UnixPrintJob.print() not implementing that
  option, while it should be an easy one.

  P.s.: as a workaround, one could add a default option to the printer
  via lpoptions - still, I think it's a bug / missing feature in JDK.

  ProblemType: Bug
  DistroRelease: Ubuntu 22.04
  Package: openjdk-11-jdk 11.0.16+8-0ubuntu1~22.04
  ProcVersionSignature: Ubuntu 5.15.0-43.46-generic 5.15.39
  Uname: Linux 5.15.0-43-generic x86_64
  ApportVersion: 2.20.11-0ubuntu82.1
  Architecture: amd64
  CasperMD5CheckResult: pass
  CurrentDesktop: XFCE
  Date: Thu Aug 11 08:39:03 2022
  InstallationDate: Installed on 2022-04-23 (109 days ago)
  InstallationMedia: Xubuntu 22.04 LTS "Jammy Jellyfish" - Release amd64 (20220419)
  RebootRequiredPkgs: Error: path contained symlinks.
  SourcePackage: openjdk-lts
  UpgradeStatus: No upgrade log present (probably fresh install)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/openjdk-lts/+bug/1985042/+subscriptions