Questions tagged [cups4j]

Cups4j is a java library that provides an interface to the CUPS, the open-source printing protocol.

Cups4j is a java library that provides an interface to the CUPS, the open-source printing protocol.

Cups4j advertises the following features (see here for full details):

  1. One can get printer objects from a CUPS server in order to print or monitor jobs;
  2. obtain the default printer;
  3. print documents;
  4. learn the status of a print job;
  5. cancel print jobs.
15 questions
3
votes
1 answer

Get no. of pages before print in cups

What I have done:- I am using cups4j api and I am getting the print job attributes(Job ID, Job Name, Page Size, Job sender, Creation date and Completion date) of the print job that are being sent to the printer. What I want:- total no. of pages…
s.Tripathi
  • 41
  • 4
2
votes
1 answer

Unable to get paper colors from cups 2.0.1 using cups4j

I'm currently using Cups Version 1.2.4 for a print-application. A mandatory feature is to read the paper color (White Paper, Blue Paper, ..). This is done by reading the mediaSupported tag with an old print library called jipsi. The…
Bahnstreik
  • 21
  • 1
2
votes
1 answer

Slow priniting when I use Python CUPS

When i try to print document with CUPS and xhtml2pdflibrary - everything is good, but i get very slow printing. Is there any solution for this problem? Here is Python code: import cups from xhtml2pdf import pisa def main(): filename =…
Stopfan
  • 1,649
  • 15
  • 22
1
vote
0 answers

Unable to add the ipp network printer to cup server

I would like to add the network printer to cups server using http call ( printer_host_name, port). I couldn't find the way to add the printer to cupserver from cups api documentation. Please share the cup api which allows to add ipp network printer…
Krishnan U
  • 11
  • 2
1
vote
0 answers

In java cups library want to fetch all the jobs attributes of given print job with the completion time?

I want to fetch cups all data job attributes i.e (job-id, job-name, job-state and job-completion-time) Repo : https://github.com/harwey/cups4j There are two methods to fetch : In [IppGetJobsOperation->getPrintJobs()] First method fetch all cups…
1
vote
0 answers

CUP4J returns 'null' for printer status

I was trying to monitor state of network printer using CUPS4J that is connected to CUPS (v2.2.1). Though I have not used a real printer hardware, however I was able to connect ippserver (an IPP compatible printer simulator) as a network printer to…
Rajib Deka
  • 551
  • 1
  • 7
  • 22
1
vote
1 answer

Error thrown while printing to IPP printer in android using Cups4j

I'm trying to print to an IPP printer installed on a linux machine using Cups4j from android. Here's the code, I more or less just copied what they have written on their github page. ByteArrayOutputStream os = stvoriRacun(narudzba, djelatnik,…
Defranz
  • 11
  • 2
1
vote
1 answer

How to create a raw (-o raw) PrintJob in Cups4J?

Currently I have some problems using cups4j. For example under linux you can print on a cups printer like this: echo -e "test Text\\r" | lp -o raw -h -d Important for me is the "-o raw" flag. My problem is while priniting…
Charmin
  • 711
  • 20
  • 30
1
vote
0 answers

Printing in java with javax.print

I have little experience with Java's Printer Api. Now I'm working on a java entrprise application that is hosted on a linux Server and this application print some documents, actually I'm using javax.print package to manage this situation. This is…
Skizzo
  • 2,883
  • 8
  • 52
  • 99
1
vote
1 answer

Communicate with Java to TLS-encrypted CUPS print server

I'm trying to communicate with a CUPS print-server that has "Encryption Required" set for all its connections. This means that, when you try to establish a connection to it, it asks to upgrade the connection to TLS-encrypted one, and neither Cups4j…
AlexK
  • 11
  • 1
1
vote
1 answer

cups4J printing multiple copies

i have the following code: FileInputStream fis = new FileInputStream("C:/test.pdf"); //PrintJob.Builder test = new PrintJob.Builder(fis); //test.duplex(true); …
jtyreman
  • 256
  • 3
  • 15
0
votes
2 answers

CUPS - Cups4j - Define Page/Media Size

I am using Cups4j in a java app, under Linux, with a thermal printer, I need to define the size of the media, so I can use 80mm or 50mm paper rolls on the printer. There is an "attribute" method, but I don't know (there is not really much info) how…
pojomx
  • 780
  • 2
  • 11
  • 24
0
votes
1 answer

How to get all cups avaible variables to set on cups4j?

On cups4j I can set variables such as: attributes.put("job-attributes", "print-quality:enum:4#fit-to-page:boolean:true#sheet- collate:keyword:collated"); How do I find out all variables that can be set? Thanks.
Thiago Sayão
  • 2,197
  • 3
  • 27
  • 41
0
votes
0 answers

cups4j : how to print with monochrome attribute

I want to print document using cups4j with monochrome attribute. I can't find a job-attributes for this option. Could you help me please ? The part of code related to attribute is: HashMap attributeMap = new HashMap
Khalil_B
  • 59
  • 7
0
votes
0 answers

Change font type of printer in CUPS

I am simply looking for a way to change the font type of a printer in CUPS. I have tried updating fonts, changing PPD's, changing font directories, and updating charset files. The only partial solution I found was to change the charset file to…
runninghair08
  • 313
  • 4
  • 7