Simple Print job
I'm looking for a simple way to create a print job from a string and send it to the default printer. The closest i've gotten is this...
try
{
SimpleDoc printDoc = new SimpleDoc("Happyness is me", new DocFlavor("text/plain","java.lang.String" ), null);
PrintServiceLookup.lookupDefaultPrintSer vice().createPrintJob().print(printDoc,n ull);
}
catch(Exception noPrint)
{System.out.println(noPrint);}
It is yelling at me saying the DocFlavor is not vailid.
There should be a simple way of doing this, but all the online tutorials talk about page formatting or adding graphics...
Thanks.
try
{
SimpleDoc printDoc = new SimpleDoc("Happyness is me", new DocFlavor("text/plain","java.lang.String"
PrintServiceLookup.lookupDefaultPrintSer
}
catch(Exception noPrint)
{System.out.println(noPrint);}
It is yelling at me saying the DocFlavor is not vailid.
There should be a simple way of doing this, but all the online tutorials talk about page formatting or adding graphics...
Thanks.
