HPInc / jipp

A Java-compatible implementation of IPP
MIT License
153 stars 42 forks source link

Implement number of copies #16

Closed brunofjesus closed 6 years ago

brunofjesus commented 6 years ago

I'm trying to specify the number of copies to print, the problem is that I didn't find this attribute.

I am trying to accomplish something like this:

List<AttributeGroup> attributeGroups = new ArrayList<>();
        attributeGroups.add(
                groupOf(operationAttributes,
                        attributesCharset.of("utf-8"),
                        attributesNaturalLanguage.of("en"),
                        printerUri.of(uri),
                        documentFormat.of(format)));
        attributeGroups.add(
                groupOf(jobAttributes,
                          copies.of(2))
                                );

IppPacket printRequest = new IppPacket(IppPacket.DEFAULT_VERSION_NUMBER, Operation.printJob.getCode(), requestId, attributeGroups);
GladeDiviney commented 6 years ago

Yes, many attributes are missing at this point -- we'll have them all present when #15 is done. In the meantime, you can easily create your own type for this:

IntegerType copies = new IntegerType("copies");