Giter VIP home page Giter VIP logo

Comments (3)

C4J avatar C4J commented on September 24, 2024

from cups4j.

harwey avatar harwey commented on September 24, 2024

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?

from cups4j.

harwey avatar harwey commented on September 24, 2024

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.

from cups4j.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.