How to print strings with line breaks in java

前端 未结 9 676
刺人心
刺人心 2020-12-01 17:10

I need to print a string using java so I fond the following solution After googled a lot. I have done some changes to print the string without showing the print dialog. My p

9条回答
  •  孤街浪徒
    2020-12-01 17:35

    I think you are making it too complex. AttributedString is used when you want to store attributes - in Printing Context. But You are storing data inside that. AttributedString

    Simply, store your data into Document object and pass properties like Font, Bold, Italic everything in AttributedString.

    Hope this will be helpful A quick tutorial And In depth tutorial

提交回复
热议问题