jipp icon indicating copy to clipboard operation
jipp copied to clipboard

How to choose tray of the printer?

Open artem24630 opened this issue 3 years ago • 1 comments

I need to print using the second tray if the first is empty, and printer can do this itself but not it doesn't (maybe I don't write some params to ipp request?). And I tried to choose a tray by writing putOperationAttributes(MediaCol.mediaSource.of("tray-2")) but it doesn't work. How to cope with it?

artem24630 avatar Feb 28 '22 13:02 artem24630

Hello, Did you try to set this attribute to the job instead of the operation?

Example:

MediaCol mediaCollection = new MediaCol();
		mediaCollection.setMediaSource(new KeywordOrName(MediaSource.bottom));

IppPacket printRequest = IppPacket.printJob(uri)
	.putOperationAttributes(documentFormat.of("application/pdf"), pageRanges.of(new IntRange(1, 1)))
	.putJobAttributes(mediaCol.of(mediaCollection)).build();

I think it worked for me. Cheers

teemoo7 avatar Nov 18 '22 14:11 teemoo7