• Post Reply Bookmark Topic Watch Topic
  • New Topic

Print not working correctly on oracle Linux  RSS feed

 
Georges Salameh
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to print a text file from JAVA, the below code works perfectly on windows and some linux environments, but when i try this code on Oracle linux, the printed page contains only "IB" and the rest is blank. Below is the code i am using.

 
fred rosenberger
lowercase baba
Bartender
Posts: 12565
49
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't have the answer to your question, but I can give you some tips on how to improve your chances of getting an answer.

First, please learn to use code tags. unformatted java is very hard to read. Can you try editing your post to use them? Highlight all the java, then click the little "code" button above, and it will wrap your source with format tags that look like

[ code][ \code]


(only without the spaces)

Next, it helps if you post a complete self-contained example. One thing that a lot of people like to do is take your code, compile and run it. You have only given us a snippet, so if they wanted to do that, they'd have to write a bunch more code. Many folk will say "not worth the effort and time".


To your specific problem:
Have you validated that the file contains what you really think it does on both machines? No weird, non-printing characters?
Instead of printing to a page, what happens when you print to the screen? Do you only get "IB", or do you get the while file you are expecting? Right now, you don't know if hte problem is in the read or the write. So, try changing the write part and see. If it prints ok to the screen, you can try writing to a new file.
Could it be the printer, and not the computer? Maybe the printer requires something different?

I know nothing about printing pages...The above are just general debugging tips.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!