Hi!<div>This questions has been asked many times but i could not find any reply anywhere</div><div>I want to send raw data lets say a pcl file to a shared printer on windows.</div><div><br></div><div>When I do SmbFile[] files = file.listFiles();</div>
<div>I discover my printer properly, there is no issue</div><div><br></div><div>To send the data to the printer i am doing this</div><div><br></div><div><div><span class="Apple-tab-span" style="white-space:pre">        </span>        byte[] buf = new byte[1024];</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>        //test.prn is just any prn file.</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>        String root = &quot;d:\\test.prn&quot;;</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>        FileInputStream fin = new FileInputStream(new File(root));</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>        // Always get exception here Parameter incorrect</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>        SmbFileOutputStream fos = new SmbFileOutputStream(printer);</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>        int len;</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>        while ((len = fin.read(buf)) &gt; 0){</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>          fos.write(buf,0,len);</div><div>
<span class="Apple-tab-span" style="white-space:pre">        </span>        }</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>        fin.close();</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>        fos.close();</div>
<div><br></div><div><br></div>where printer is the smbfile of printer i got from listFiles();</div><div>I always get exception at parameter incorrect at SmbFileOutputStream(printer) .</div><div><br></div><div>If instead of SmbFileOutputStream() i use </div>
<div><br></div><div>FileOutputStream fos = new FileOutputStream(\\\\10.88.183.236\\myPrinter);</div><div>PrintStream ps = new PrintStream(fos);</div><div><br></div><div>it works fine on windows machine , but i can not use this as I need to print from android.</div>
<div><br></div><div><br></div><div>Pls. advice what I am doing wrong?</div><div><br></div><div>Thanks</div><div><br><br>
</div>