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 ......
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 ......
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 ......
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 ......
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);
}
} ......
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 ......