question

Rohit Bhardwaj avatar image
Rohit Bhardwaj asked Rohit Bhardwaj commented

Print a part of string as bold using TextPrintJob

Hi there,

I want to print a part of a string in BOLD because it is the Title of the string. I saw this example and found it to be working for setting it on a textView but I don't have a textView and want to simply print the string using TextPrintJob. Below is the code on how I print the string;

PrintJob printJob = new TextPrintJob.Builder().text(messageToPrint[0]).build();
new PrintJobsConnector(con).print(printer, printJob);

How can I achieve this?


Please advice.

Print
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
David Marginian avatar image
David Marginian Deactivated answered Rohit Bhardwaj commented
4 comments
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Bryanne Vega avatar image Bryanne Vega commented ·

I highly recommend ViewPrintJob as it cna be modified with ease in run time!


Good luck tho :(

1 Like 1 ·
Rohit Bhardwaj avatar image Rohit Bhardwaj Bryanne Vega commented ·

I tried https://community.clover.com/questions/11276/i-am-generating-manually-report-data-and-able-to-p.html this post and used the same code to print the view but it didn't print for me. I got a toast message saying that "View sent to printer" but it didn't print. Is there anything else I need to do apart from the code mentioned in the post above?

0 Likes 0 ·
Rohit Bhardwaj avatar image Rohit Bhardwaj commented ·

I had this ViewPrintJob in mind just wanted to know if I can achieve this using TextPrintJob.


Thank you.

0 Likes 0 ·
Bryanne Vega avatar image Bryanne Vega Rohit Bhardwaj commented ·

As the name implies, text print job is only text.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Welcome to the
Clover Developer Community