File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

using printer device fonts

 
simo mon
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi i have a little bit of experience printing in java..

i can query devices, get printerService attributes, and print using printable interface using a graphics 2d object all ok..

i have made a system which needs to print receipts, and using the graphics stuff makes the receipts far too light, i contacted the manufacturer and they said to use the printers native font ?

i have been playing around with this for a few days now and can't seem to get anything happening....

is there an "easy" or "standard" way to use the printers device fonts, i have been reading the api's but alot of that is beyond my scope atm

any help would be greatly appreciated

thanks
 
Darryl Burke
Bartender
Posts: 5115
11
Java Netbeans IDE Opera
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Simo, welcome to the Ranch! Please BeForthrightWhenCrossPostingToOtherSites
http://www.java-forums.org/new-java/35130-using-printer-device-fonts.html
 
simo mon
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for the heads up and sorry didn't occur to me that this was bad

everyone i "cross posted" this on the above link and i will cross post the solution.. once i get there

this is probably in the class of " your on your own with that one " so i'll put up what i got in case someone else is struggling


i worked out a way to communicate directly to the printer by sending stuff ( hex codes ) to COM1 BUT !!! this only works windows and on the machine that the printer is connected to




i have also worked out how to use the java printing stuff so that it uses the "printer defined font"




so the above code will use the default font for the printer, which is the "DocFlavor.BYTE_ARRAY.AUTOSENSE" part....

what i am trying to do now is combine part1 code with part2 code...

ie i am trying to send hex values to the printer using code like part2

Iv'e got a really ugly solution which is using an rmi server to call com1 on the correct machine but i want to try to avoid using it ???

any help or insight would be appreciated :

thanks again

and sorry for the un announced cross posting !

 
Campbell Ritchie
Sheriff
Pie
Posts: 47258
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
. . . and welcome to JavaRanch
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic