Hi
      Everithing un your code its ok, the problem is the docFlavor, depends
of the OS and the type of printer driver if you could print some kind of
doc or not.

      One suggestion could be, create a component with TextEditor put the
HTML in there and print that component with the MIME type
"application/x-java-jvm-local-objectref".

      You can check the format supported here:

      InputStream is = new BufferedInputStream(
                    new FileInputStream("myhtml.html"));

                System.err.println("Abre el Archivo");

                // Find the default service
                DocFlavor flavor = DocFlavor.INPUT_STREAM.TEXT_HTML_HOST;
                System.err.println("Crea el DocFlavor");
                PrintService services[] =
PrintServiceLookup.lookupPrintServices(null,null);

                for (int a=0 ; a < services.length; a++)
                {
                    DocFlavor flavors[] =
services[a].getSupportedDocFlavors();
                    for (int b= 0 ; b < flavors.length ;b++)
                    {
                        System.out.println("Mime/type:"
+flavors[b].getMimeType());
                    }
                }

                PrintService service = services[0];

                if(flavor == null || !service.isDocFlavorSupported(flavor))
                {
                    System.out.println("Flavor dont exist");
                    return;
                }

Regards,
Ignacio Diazmacip L�pez
Integration Architect
DAQ


                                                                                       
                                       
                      jeanyves.beaujea                                                 
                                       
                      [EMAIL PROTECTED]              To:      "JDJList" 
<[EMAIL PROTECTED]>                               
                                               cc:      (bcc: IGNACIO DIAZMACIP 
LOPEZ/Cemtec/Cemex)                           
                      10/10/2002 09:52         Subject: [jdjlist] printing html 
document                                      
                      a.m.                                                             
                                       
                      Please respond                                                   
                                       
                      to "JDJList"                                                     
                                       
                                                                                       
                                       
                                                                                       
                                       




Hi all,

I've a problem with the javax.print package.
My application create a html file.  I would like print it directly in my
app whitout launch a browser.

This is my code  :

          ....


Exception returned : sun.print.PrintJobFlavorException : invalid fla   vor

Can anyone explain me how to print a html document  and what's my mistake ?

Thanks in advance.

Jean-Yves Beaujean
Service Informatique
CORMAN SA



____________________________________________________
To change your JDJList options, please visit:
http://www.sys-con.com/java/list.cfm

Be respectful! Clean up your posts before replying
____________________________________________________





____________________________________________________________________________
For your protection, this e-mail message has been scanned for viruses.
Visit us at http://www.neoris.com/

____________________________________________________
To change your JDJList options, please visit:
http://www.sys-con.com/java/list.cfm

Be respectful! Clean up your posts before replying
____________________________________________________

Reply via email to