word wrap in java
i got this code for printing by googling.
Code:
import javax.print.*; thanks |
did you try different types of doc flavors? because you can set up different types of documents and print sizes?
what is filename? is it a file of google results or something else, because if its a of google results, you could parse the file, to make it wrap and then stream it into another or same file....just a thought. |
filename is being supplied to the class. it is the name of the file to be printed. i havent even understood the code ... and am currently reading a very old tutorial on printing in java
http://www.javaworld.com/javaworld/j...020-print.html how can i change the print sizes .... i am trying to figure tht out ... just came across the tutorial on the link above ... hopefully i will get the answers there thanks neways |
if you're using a fixed-width font you could just count the characters between "\n"'s and when it gets to 80 or textfield.size().width/8 or whatever insert a "\n"... but that might be slow... an alternative (as previously suggested) is to check which subclass (or implementation... can't remember if it's an interface) of Document the textfield's using and even manually set it (this well may cause it to render html as plain text).
HTH |
All times are GMT -5. The time now is 03:02 AM. |