A
Alexander Brown
Hello,
I am trying to find a way to print a multilined string using java.
I have tried using a class called DocumentRenderer which i found at
http://www.fawcette.com/javapro/2002_12/online/print_kgauthier_12_10_02/ but
my text keeps getting cut at the right hand edge of the page. On some lines
it does wrap, but always some of the text is missing. The article does
suggest that font measuring is faulty under windows and i guess maybe this
is what is happening here.
Can anyone help as to how to print a large string in a wrapped style? I
dont really have time to write the code from bare bones!
Thanks in advance,
Alex
p.s. if anyone has experience of the particular class i have mentioned then
this is the code i have used:
String myString = "A very long multilined string";
JEditorPane j = new JEditorPane("text/plain",myString);
DocumentRenderer d = new DocumentRenderer();
d.print(j);
I am trying to find a way to print a multilined string using java.
I have tried using a class called DocumentRenderer which i found at
http://www.fawcette.com/javapro/2002_12/online/print_kgauthier_12_10_02/ but
my text keeps getting cut at the right hand edge of the page. On some lines
it does wrap, but always some of the text is missing. The article does
suggest that font measuring is faulty under windows and i guess maybe this
is what is happening here.
Can anyone help as to how to print a large string in a wrapped style? I
dont really have time to write the code from bare bones!
Thanks in advance,
Alex
p.s. if anyone has experience of the particular class i have mentioned then
this is the code i have used:
String myString = "A very long multilined string";
JEditorPane j = new JEditorPane("text/plain",myString);
DocumentRenderer d = new DocumentRenderer();
d.print(j);