易截截图软件、单文件、免安装、纯绿色、仅160KB
热门标签: c c# c++ asp asp.net linux php jsp java vb Python Ruby mysql sql access Sqlite sqlserver delphi javascript Oracle ajax wap mssql html css flash flex dreamweaver xml
 最新文章 :

用java判断打印机打印服务的能力

import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import javax.print.DocFlavor;
import javax.print.StreamPrintService;
import javax.print.StreamPrintServiceFactory;
import javax.print.attribute.Attribute;
public class Main {
  public static void main(String[] argv) throws Exception {
    OutputStream fos = new BufferedOutputStream(new FileOutputStream("filename.ps"));
    DocFlavor flavor = DocFlavor.INPUT_STREAM.GIF;
    StreamPrintServiceFactory[] factories = StreamPrintServiceFactory
        .lookupStreamPrintServiceFactories(flavor, DocFlavor.BYTE_ARRAY.POSTSC ......

用Java列出当前系统打印机清单

import javax.print.DocFlavor;
import javax.print.PrintService;
import javax.print.PrintServiceLookup;
import javax.print.attribute.Attribute;
import javax.print.attribute.PrintServiceAttributeSet;
import javax.print.attribute.standard.PrinterName;
public class Main {
  static public void main(String args[]) throws Exception {
    PrintService pss[] = PrintServiceLookup.lookupPrintServices(null, null);
    for (int i = 0; i < pss.length; ++i) {
      System.out.println(pss[i]);
      PrintService ps = pss[i];
      PrintServiceAttributeSet psas = ps.getAttributes();
      Attribute attributes[] = psas.toArray();
&nbs ......

用Java识别当前计算机中可用的打印服务

 import javax.print.DocFlavor;
import javax.print.PrintService;
import javax.print.PrintServiceLookup;
import javax.print.attribute.AttributeSet;
import javax.print.attribute.HashAttributeSet;
import javax.print.attribute.standard.ColorSupported;
import javax.print.attribute.standard.PrinterName;
public class Main {
  public static void main(String[] argv) throws Exception {
    PrintService[] services = PrintServiceLookup.lookupPrintServices(null, null);
    PrintService service = PrintServiceLookup.lookupDefaultPrintService();
    services = PrintServiceLookup.lookupPrintServices(DocFlavor.INPUT_STREAM.GIF, null);
    AttributeSet aset = new HashAttributeSet();
    aset.add(new PrinterName("HP La ......

在Java中使用流印刷服务

 import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import javax.print.Doc;
import javax.print.DocFlavor;
import javax.print.DocPrintJob;
import javax.print.SimpleDoc;
import javax.print.StreamPrintService;
import javax.print.StreamPrintServiceFactory;
import javax.print.event.PrintJobAdapter;
import javax.print.event.PrintJobEvent;
public class Main {
  public static void main(String[] args) throws Exception{
    InputStream is = new BufferedInputStream(new FileInputStream("filename.gif"));
    OutputStream fos = new BufferedOutputStream(new FileOutputStream("filename.ps"));
    DocFlavor&n ......

使用Java工厂创建一个打印服务器

 import java.io.BufferedOutputStream;
import java.io.FileOutputStream;
import java.io.OutputStream;
import javax.print.DocFlavor;
import javax.print.StreamPrintService;
import javax.print.StreamPrintServiceFactory;
public class Main {
  public static void main(String[] argv) throws Exception {
    StreamPrintServiceFactory[] factories = StreamPrintServiceFactory
        .lookupStreamPrintServiceFactories(null, null);
    OutputStream fos = new BufferedOutputStream(new FileOutputStream("outfile.ps"));
    StreamPrintService service = factories[0].getPrintService(fos);
  }
} ......

用Java获取默认值打印作业能力

 import java.io.BufferedOutputStream;
import java.io.FileOutputStream;
import java.io.OutputStream;
import javax.print.DocFlavor;
import javax.print.StreamPrintService;
import javax.print.StreamPrintServiceFactory;
import javax.print.attribute.Attribute;
import javax.print.attribute.standard.Destination;
public class Main {
  public static void main(String[] argv) throws Exception {
    OutputStream fos = new BufferedOutputStream(new FileOutputStream("filename.ps"));
    DocFlavor flavor = DocFlavor.INPUT_STREAM.GIF;
    StreamPrintServiceFactory[] factories = StreamPrintServiceFactory
        .lookupStreamPrintServiceFactories(flavor, DocFlavor.BYTE_ARRAY.POSTSCRIPT.getMimeType());
    Strea ......
总记录数:40319; 总页数:6720; 每页6 条; 首页 上一页 [6112] [6113] [6114] [6115] 6116 [6117] [6118] [6119] [6120] [6121]  下一页 尾页
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号