Questions tagged [java-print]

45 questions
19
votes
6 answers

Print a PDF file using PrinterJob in Java

I have an issue when trying to print a PDF file using Java. Here is my code: PdfReader readFtp = new PdfReader(); // This class is used for reading a PDF file PDDocument document =…
user2331844
  • 201
  • 1
  • 2
  • 7
13
votes
6 answers

Cannot specify the correct size for printing

We have acquired a brother QL-700 printer recently and we are doing some sticker printing through this machine. The paper that we have been feeding is a 62mm-wide sticker roll without "length" restriction. The issue is, no matter how I do (I've…
Lionel Chan
  • 7,894
  • 5
  • 40
  • 69
6
votes
1 answer

Why is PrinterState always null?

I need to have more control about my printer and then I'm trying to get PrinterState of my printer and then use PrintStareReasons. My code is the following: public void checkPrinterStatus(){ try { logger.info("Check --------------…
Skizzo
  • 2,883
  • 8
  • 52
  • 99
3
votes
1 answer

Tabular Format / printf Spacing in Java Assistance

So this snippet of code has been bugging me for the past hour or so. Basically, part of my program's task is to display data in a sort of tabular format. Only thing left is to just make the output look nice, so to speak. Here is the (example)…
3
votes
0 answers

printing in java through barcode printer fit to scale

I am trying to print barcode image files using java. I have Label Writer 450 Turbo. The label dimension is 2" X 0.75" inches, When I print the image from Photoshop with scale to fit option every thing works fine. But with java code it does not…
Mohd Alomar
  • 953
  • 1
  • 13
  • 30
3
votes
1 answer

Get Printer Status from Java PrintService

How can I get Printer status from a network printer that has driver installed on out PC? In particular I want to know if the printer is busy (currently printing) or idle (just waiting for print jobs)?
Dan Smith
  • 423
  • 2
  • 5
  • 17
2
votes
1 answer

Weird symbols where printing PDF

I want to print PDF file on network printer. There are no problem with printing txt file or String, but problem arises when I'm trying to print PDF/JEPG/DOC files. Printer: Samsung SCX-6545 Series PCL public static void printFile(String filename)…
Artur P.
  • 51
  • 1
  • 8
2
votes
0 answers

How to send esc/p2 commands to dot matrix printer in Java

I am printing a string using JtextArea. Here is my code. JTextArea text = new JTextArea(); text.setText(XmlReceiptPrinter.sb.toString()); text.setFont(new Font("Courier New", Font.BOLD, 9)); PrintRequestAttributeSet attrSet = new…
Madhu
  • 9
  • 1
  • 8
1
vote
0 answers

How to print document in Black and white using Monochrome option Mac OS?

I am unable to print pdf with MONOCHROME option on MAC, even monochrome option is selected but still on MAC its printing in COLOR but on windows its working fine for both options MONOCHROME and COLOR. Plus, On MAC settings are disable even proper…
Waqas Ahmed
  • 41
  • 1
  • 7
1
vote
1 answer

File names from print queue java

How can I get the file names in the print queue from Java? I would like to get all items in the print queue, even those not started through the PrintJob API. I know that I can use the PrintService#getAttributes method to get all Attributes and then…
Adrian Jandl
  • 2,985
  • 4
  • 23
  • 30
1
vote
1 answer

Using Java to send PJL commands to HP 4515 Printer

I am trying to send Printer Job Language commands to a HP 4515 printer. However, the printer does not print anything. Below is my code. The printer is located remotely and I can only ask someone there to check if anything is printed out.…
Dustin Sun
  • 5,292
  • 9
  • 49
  • 87
1
vote
0 answers

Java Printing Issue with Media Size

I will print labels over jasper-report on a brother QL-700. My problem is that java tells the printer driver the wrong label format ☹ - When I use the printer dialog in Java, I can’t found the correct page size in the drop down list - The page…
athos
  • 11
  • 1
1
vote
1 answer

java - "ps: stack underflow" when sending postscript directly to network printer

I wrote a piece of Java code to send PDF-turned postscript scripts to a network printer via Socket. The files were printed in perfect shape but every job comes with one or 2 extra pages with texts like ps: stack underflow or error undefined…
Dustin Sun
  • 5,292
  • 9
  • 49
  • 87
1
vote
1 answer

How to print a file directly on network printer in java.. Printer is not configured in system where application is running?

I am working on project to implementing print in java on network printer, printer is not configured. I am having problem while printer service lookup always returning null. in Java application, is there anyway to print a file on printer which not…
Pandey Amit
  • 657
  • 6
  • 19
1
vote
1 answer

How do I output this array of test grades?

I am creating an array to print test grades and their cutoff. However, every time my output is…
1
2 3