Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specify Paper Tray #12

Closed
mntwinsfan opened this issue Feb 2, 2019 · 3 comments
Closed

Specify Paper Tray #12

mntwinsfan opened this issue Feb 2, 2019 · 3 comments

Comments

@mntwinsfan
Copy link

Is there anyway to specify the paper tray to use when printing?

@C4J
Copy link

C4J commented Feb 3, 2019 via email

@harwey
Copy link
Owner

harwey commented Feb 3, 2019

Something like the following should work. Please give it a try and come back if it does not work for you.

CupsClient client = new CupsClient("localhost", 631);

Map<String,String> attributes = new HashMap<String,String>();
attributes.put("job-attributes", "media:keyword:A4");

PrintJob printJob = new PrintJob.Builder(new FileInputStream("cups4j.ps"))
.userName("user").mediaSource("ManualPaper").attributes(attributes).build();

client.getDefaultPrinter().print(printJob);

Is there anyway to specify the paper tray to use when printing?

@harwey harwey mentioned this issue Feb 3, 2019
@harwey
Copy link
Owner

harwey commented Feb 3, 2019

As it's not very useful mixing issues I started a new issue to talk about this here:
#13

I know this might seem out of scope for a linux/macos java library but in my app I support printing in all supported environments in which there is a java runtime including windows. It would be great if the library also implements windows as an operating system by detecting the OS it’s running on and calling windows to replicate the same functionality. You would then be able to write code which is truly OS independent. I specially need to send print jobs (jaserreports) to a user selected print queue.

On 2 Feb 2019, at 05:39, mntwinsfan @.***> wrote: Is there anyway to specify the paper tray to use when printing? — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <#12>, or mute the thread https://github.com/notifications/unsubscribe-auth/ATmdTo1HSkCn-wxMXgSknPAoTDpbjLbrks5vJSSegaJpZM4afbvH.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants