从Java打印,更改要打印的字符串的字体

时间:2016-12-09 10:29:55

标签: java printing

我有一个java代码在纸上打印一段,我想改变字符串的字体。

l_print_data = formatPrintDataNewFormat(l_print_data_format, l_arr, i+1,p_request.passwordType);    //formatPrintDataNew(l_print_data_format, l_arr);formatPrintData(l_print_data_format, l_arr);  version 1.7 change by Yogeshwar
                InputStream is = new ByteArrayInputStream(l_print_data.getBytes("UTF-8"));
                PrintRequestAttributeSet attributes = new HashPrintRequestAttributeSet();
                DocFlavor flavor =  DocFlavor.INPUT_STREAM.AUTOSENSE;
                DocPrintJob job = printer_service.createPrintJob();
                Doc doc= new SimpleDoc(is, flavor, null);
                PrintJobWatcher pjDone = new PrintJobWatcher(job);
                job.print(doc, attributes);
                pjDone.waitForDone();
                is.close();

l_print_data是一个字符串,我想在纸上更改相同的字体到一个特别不同的类型。我如何实现这一目标?请帮助。

0 个答案:

没有答案