|
|
|
|
@ -125,13 +125,22 @@ public class ExamePDF {
|
|
|
|
|
public void print( byte []pdf )
|
|
|
|
|
throws Exception
|
|
|
|
|
{
|
|
|
|
|
FileOutputStream fos = new FileOutputStream( System.getProperty( "user.home" ) + "\\report_ficha.pdf" );
|
|
|
|
|
|
|
|
|
|
FileOutputStream fos = new FileOutputStream( System.getProperty( "user.home" ) + System.getProperty( "file.separator" ) + "report_ficha.pdf" );
|
|
|
|
|
fos.write( pdf );
|
|
|
|
|
fos.close();
|
|
|
|
|
System.out.println( "File saved." );
|
|
|
|
|
Process proc = Runtime.getRuntime().exec( "cmd.exe /c \"" + System.getProperty( "user.home" ) + "\\report_ficha.pdf\"" );
|
|
|
|
|
Process proc;
|
|
|
|
|
if( System.getProperty( "os.name" ).startsWith( "Windows" ) )
|
|
|
|
|
{
|
|
|
|
|
proc = Runtime.getRuntime().exec( "cmd.exe /c \"" + System.getProperty( "user.home" ) + System.getProperty( "file.separator" ) + "report_ficha.pdf\"" );
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
proc = Runtime.getRuntime().exec( "open \"" + System.getProperty( "user.home" ) + System.getProperty( "file.separator" ) + "report_ficha.pdf\"" );
|
|
|
|
|
}
|
|
|
|
|
proc.waitFor();
|
|
|
|
|
new File( System.getProperty( "user.home" ) + "\\report_ficha.pdf" ).delete();
|
|
|
|
|
new File( System.getProperty( "user.home" ) + System.getProperty( "file.separator" ) + "report_ficha.pdf" ).delete();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public byte[] createPDF( Hashtable values )
|
|
|
|
|
|