Questions tagged [java-print]
45 questions
0
votes
0 answers
Java print Service API and a non default printer
So i have an application that sends tasks to a printer. Everything is working fine if the printer i'm sending tasks to is set to "default printer", the moment i change the default printer and try sending tasks again to this same printer which is…

R.Ro
- 449
- 1
- 7
- 15
0
votes
0 answers
PrintWriter.println - works - but not print?
i have a really suspicious case here, envolving a simple method which is supposed to write into a .txt file.
public void extractCoNLL(int n, String outputFile) throws IOException {
String msg;
PrintWriter pr = new PrintWriter(outputFile);
…
user8220047
0
votes
0 answers
How can I format/cutomize the java printing co-ordinates to the external printer?
This is billing application (like super market billing). I used the following code to print some thing in the default external printer (Posiflex)
I am working with spring-boot, maven, Java.
package com.spring.utils;
import java.awt.Color;
import…

Gnik
- 7,120
- 20
- 79
- 129
0
votes
3 answers
ArrayList Printing
I have an assignment to create an ArrayList of employees, to provide a menu to add, find, and delete employee records. I successfully managed to implement all the functions on my own, but there is a small problem. When I use the find or delete…

Vikram AJ
- 1
- 1
0
votes
0 answers
Java print frame content
I have the following code
private static Properties printProperties = new Properties();
public void print() {
PrintJob printJob = null;
try {
printJob = getToolkit().getPrintJob(this, "Draw app", printProperties);
…

Barak michaeli
- 113
- 1
- 11
0
votes
1 answer
Java printing with multiple queues with different options
I have three printer queues going to the same printer:
a, No settings standard (colour)
b, Black and white
c, Black and white + Stapled
setup in Windows. When printing to any of a, b or c the results are always the same and that is that no settings…

pokemonnogo
- 1
- 1
0
votes
0 answers
Java print pdf doesn't work
I'm trying to print a PDF file with my local printer. The Problem is when I select the printer in the printer dialog and press the print button nothing happens, the dialog just closes. I don't get any Exceptions or Warnings, the printer is just not…

RyuZz
- 581
- 8
- 30
0
votes
0 answers
java - get activity status of a printer
I have implemented a printing system in java. I need to get printer status, So I used AttributeSet in this way:
PrintService service = PrintServiceLookup.lookupDefaultPrintService();
AttributeSet attributeSet = service.getAttributes();
for…

hamed
- 7,939
- 15
- 60
- 114
0
votes
0 answers
How to print the receipt in java whose size is more than A4 paper height?(POS-Printer)
Here I have to work on pageIndex but not getting how to set it, so that I could print the long receipt whose size is more than A4 paper height in POS-Printer(paper roll)
public int print(Graphics g, PageFormat pf, int pageIndex) {
PrinterJob…

AshwinK
- 1,039
- 1
- 12
- 31
0
votes
0 answers
Are there any implementations of javax.print.StreamPrintService?
I am preparing an acceptance testing tool for java web start application. That app autoprints pdfs to system-installed printers and I want to verify if produced pdfs are correct. To do this I am looking for a way to mock printing.
I found a way to…

tporeba
- 867
- 10
- 23
0
votes
1 answer
How to print HTML and not the code using Java Print API?
I want to print an HTML file on user-defined printer without showing print dialog. Below is the code I run, but it prints the HTML code and not the actual page that is displayed in IE.
import java.io.File;
import…

ParagJ
- 1,566
- 10
- 38
- 56
0
votes
1 answer
Endorsement Epson TM-h6000IV Java Printing
I need to print to an Epson Endorsement TM-h6000iv printer (usb version) with Java. However, I read the manual without hope to find sth can help. I change in printer preferences without hope also! I try with this code of java which TextPrinter class…

Maheera Jazi
- 214
- 1
- 6
- 19
0
votes
1 answer
How to design a POS bill in java?
I'm designing a java application to a pharmacy and I wanted to print a bill for their customers. I tried using jasper reports but I was unable to design it properly.
I have created 2 jTables to display items in stock and another to display the bill.…

chalitha geekiyanage
- 6,464
- 5
- 25
- 32
-1
votes
1 answer
printf statement with multiple arguments
I am trying to print display data in a tabular format with multiple headers. I am using the following printf statement:
System.out.format("%-15s %-15s %-25s %-15s %-20s %s %n", "Id", "name", "Mode", "Total weight", "Arrival loc", "Departure…

SN1586
- 1
-2
votes
1 answer
Why does java ignore the first part of the print statement when concatenated with a boolean statement?
Suppose I have this code
public class Test{
public static void main (String args[]) {
String s = "thrones";
System.out.println("Game of" + "thrones" == s) ;
}
}
The output of the above code block is just
'false'
But…

shashank
- 47
- 1
- 8