打印~~~~如何打印ie页面中的图像和文本的混合体(ie本身的打印功能不可以) 真的很不好意思,我没有做过 "把ie页面中的图像和文本的混合体打印出来"!帮不了你! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 楼上的!!如果只打印图片您做过没有??? import javax.print.*;import javax.print.attribute.*;import javax.print.attribute.standard.*;import java.io.*;public class PrintFileTest{ public static String TMP_FILE="C:\\172.gif"; public static void main(String[] args){ String filename = TMP_FILE; PrintRequestAttributeSet pras = new HashPrintRequestAttributeSet(); DocFlavor flavor = DocFlavor.INPUT_STREAM.GIF; PrintService printService[] = PrintServiceLookup.lookupPrintServices(flavor, pras); PrintService defaultService = PrintServiceLookup.lookupDefaultPrintService(); PrintService service = ServiceUI.printDialog(null, 200, 200,printService, defaultService, flavor, pras); if (service != null) { try { DocPrintJob job = service.createPrintJob(); FileInputStream fis = new FileInputStream(filename); DocAttributeSet das = new HashDocAttributeSet(); Doc doc = new SimpleDoc(fis, flavor, das); job.print(doc, pras); // Thread.sleep(10000); }catch(Exception e) { e.printStackTrace(); } } System.exit(0); }}这段代码可以做成Applet??? 关于clone的一个小问题(急) java .do文件 要传递给servlet 而jsp文件不需要,是這樣的嗎? 引入swing.JOptionPane和 text.DecimalFormat,编译得不出答案 用java实现常用数据结构栈和队列. 万年历 问个StringTokenizer的问题 java 如何判断两个凸图形相交??? 哪有<<Java2 图形设计 卷2: Swing>>下载 我想在调JTable的列宽时,产生一个事件,我该加什么侦听? 求在java程序运行过程中加载jar文件的方法 JCretor 3.0中main方法的问题
如果只打印图片您做过没有???
import javax.print.*;
import javax.print.attribute.*;
import javax.print.attribute.standard.*;
import java.io.*;public class PrintFileTest{ public static String TMP_FILE="C:\\172.gif";
public static void main(String[] args){
String filename = TMP_FILE;
PrintRequestAttributeSet pras = new HashPrintRequestAttributeSet();
DocFlavor flavor = DocFlavor.INPUT_STREAM.GIF;
PrintService printService[] = PrintServiceLookup.lookupPrintServices(flavor, pras);
PrintService defaultService = PrintServiceLookup.lookupDefaultPrintService();
PrintService service = ServiceUI.printDialog(null, 200, 200,printService, defaultService, flavor, pras);
if (service != null) {
try
{
DocPrintJob job = service.createPrintJob();
FileInputStream fis = new FileInputStream(filename);
DocAttributeSet das = new HashDocAttributeSet();
Doc doc = new SimpleDoc(fis, flavor, das);
job.print(doc, pras);
// Thread.sleep(10000);
}catch(Exception e)
{
e.printStackTrace();
}
}
System.exit(0);
}
}
这段代码可以做成Applet???