0

I am doing a project which will finally print a pdf file or doc file to the printer as "another user". But now I stuck on how to print document in Java.

I know there is a pdf renderer in java, developed by sun, which can convert pdf to pcl file.

After the conversion, I want to print the pcl file to remote printers. My previous way is "copy /b filename \printserver\printer", however, this approach actually is too lowlevel and cannot even display the document name, and sometime is not working.

I wonder is there a better approach of java to send the PCL file to print server, where the server can actually detect the document name and host name(which I want to specify in the program, not the original one). This one is really driving me crazy...Thanks!

Alex
  • 370
  • 1
  • 6
  • 11
  • For me now, the most difficult part is how to let the equitrac print server detect the "fake" username - I want to print as a different user, or send-to print. – Alex Jan 09 '12 at 09:01
  • programs like equitrac can often use PJL commands or other details in the print file -- you might look there. I'm not much of a Java guy but you could look to this for some ideas: http://support.microsoft.com/kb/322091 – Douglas Anderson Jan 19 '12 at 20:54

1 Answers1

1

Have you looked into java print service? You can find some useful code here http://docs.oracle.com/javase/1.4.2/docs/guide/jps/spec/printing.fm2.html

Sap
  • 5,197
  • 8
  • 59
  • 101
  • Yes. I tried that one, and it works. Also I wonder can I change the printjobAttributes to changed the default originating username and document name, especially the username. – Alex Jan 09 '12 at 07:14