public File tofile(HSSFWorkbook wb,String[] generalTitle){
  String path=System.getProperty("java.io.tmpdir");
  if (!(path.endsWith("/") || path.endsWith("\\")))   path=path + System.getProperty("file.separator");
  String prefix=StringUtils.makePrefix(generalTitle[0]);
  if (log.isLoggable(Level.FINE)) {
    log.log(Level.FINE,"Path=" + path + " Prefix="+ prefix);
  }
  File file=new File(path + prefix + ".xls");
  try {
    if (file.exists())     file.delete();
  }
 catch (  Exception e) {
    log.log(Level.SEVERE,"file",e);
    return null;
  }
  FileOutputStream fos;
  try {
    fos=new FileOutputStream(file);
    wb.write(fos);
    fos.flush();
    fos.close();
  }
 catch (  FileNotFoundException e) {
    e.printStackTrace();
  }
catch (  IOException e) {
    e.printStackTrace();
  }
  return file;
}

public File tofile ( HSSFWorkbook wb , String [ ] generalTitle ) { String path = System . getProperty ( "java.io.tmpdir" ) ; if ( ! ( path . endsWith ( "/" ) || path . endsWith ( "\\" ) ) ) path = path + System . getProperty ( "file.separator" ) ; String prefix = StringUtils . makePrefix ( generalTitle [ 0 ] ) ; if ( log . isLoggable ( Level . FINE ) ) { log . log ( Level . FINE , "Path=" + path + " Prefix=" + prefix ) ; } File file = new File ( path + prefix + ".xls" ) ; try { if ( file . exists ( ) ) file . delete ( ) ; } catch ( Exception e ) { log . log ( Level . SEVERE , "file" , e ) ; return null ; } FileOutputStream fos ; try { fos = new FileOutputStream ( file ) ; wb . write ( fos ) ; fos . flush ( ) ; fos . close ( ) ; } catch ( FileNotFoundException e ) { e . printStackTrace ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return file ; }
crea el archivo pdf a partir de un byte [ ] * * create pdf file from a byte [ ]
