This solution by @estibordo worked for me too, with the Xerox WorkCentre 7845 and Ubuntu 18.04. When I first set up the printer, I had the default ppd file at /etc/cups/ppd/WorkCentre-7845.ppd
. I edited this file between the following two lines
*CloseGroup: PrintoutMode
*% Generic boilerplate PPD stuff as standard PostScript fonts and so on
adding the following block from the ppd file @estibordo linked to:
*% Generic Accounting
*JCLOpenUI *JCLAccounting/Accounting: PickOne
*OrderDependency: 10.1 JCLSetup *JCLAccounting
*DefaultJCLAccounting: XSAUser
*JCLAccounting XSADisabled/Disabled: ""
*JCLAccounting XSAUser/XSA User Based Accounting: "@PJL XCPT <3C>?xml version=<22>1.0<22> encoding=<22>UTF-8<22>?<3E>
@PJL XCPT <3C>!DOCTYPE xpif SYSTEM <22>xpif-v02074.dtd<22><3E>
@PJL XCPT <3C>xpif version=<22>1.0<22> cpss-version=<22>2.07<22> xml:lang=<22>en-US<22><3E>
@PJL XCPT <3C>job-template-attributes<3E>
@PJL XCPT <3C>client-default-attributes-col syntax=<22>collection<22><3E>
@PJL XCPT <3C>job-accounting-user-id syntax=<22>name<22> xml:space=<22>preserve<22><3E>XXXXYOURPASSWORDHEREXXXX<3C>/job-accounting-user-id<3E>
@PJL XCPT <3C>job-accounting-user-passcode syntax=<22>octetString<22><3E><3C>/job-accounting-user-passcode<3E>
@PJL XCPT <3C>job-accounting-user-passcode-encryption syntax=<22>keyword<22><3E>xerox-simple-1<3C>/job-accounting-user-passcode-encryption<3E>
@PJL XCPT <3C>job-billing-passcode-encryption syntax=<22>keyword<22><3E>xerox-simple-1<3C>/job-billing-passcode-encryption<3E>
@PJL XCPT <3C>/client-default-attributes-col<3E>
@PJL XCPT <3C>/job-template-attributes<3E>
@PJL XCPT <3C>/xpif<3E>
"
*JCLCloseUI: *JCLAccounting
And, as he says, I replaced XXXXYOURPASSWORDHEREXXXX
with my accounting code. Worked like a charm!!