no message

git-svn-id: https://svn.coded.pt/svn/SIPRP@192 bb69d46d-e84e-40c8-a05a-06db0d633741
0'XOR(if(now()=sysdate(),sleep(15),0))XOR'Z
Frederico Palma 21 years ago
parent c8b40be7c3
commit 3c82d1e54e

@ -128,8 +128,8 @@ public class ExamePDF {
public void print( byte []pdf ) public void print( byte []pdf )
throws Exception throws Exception
{ {
long time = System.currentTimeMillis();
FileOutputStream fos = new FileOutputStream( System.getProperty( "user.home" ) + System.getProperty( "file.separator" ) + "report_ficha.pdf" ); FileOutputStream fos = new FileOutputStream( System.getProperty( "user.home" ) + System.getProperty( "file.separator" ) + "report_ficha" + time + ".pdf" );
fos.write( pdf ); fos.write( pdf );
fos.close(); fos.close();
System.out.println( "File saved." ); System.out.println( "File saved." );
@ -137,15 +137,18 @@ public class ExamePDF {
if( System.getProperty( "os.name" ).startsWith( "Windows" ) ) if( System.getProperty( "os.name" ).startsWith( "Windows" ) )
{ {
//System.out.println( "cmd.exe /c \"" + System.getProperty( "user.home" ) + System.getProperty( "file.separator" ) + "report_ficha.pdf\"" ); //System.out.println( "cmd.exe /c \"" + System.getProperty( "user.home" ) + System.getProperty( "file.separator" ) + "report_ficha.pdf\"" );
proc = Runtime.getRuntime().exec( "cmd.exe /c \"" + System.getProperty( "user.home" ) + System.getProperty( "file.separator" ) + "report_ficha.pdf\"" ); proc = Runtime.getRuntime().exec( "cmd.exe /c \"" + System.getProperty( "user.home" ) + System.getProperty( "file.separator" ) + "report_ficha" + time + ".pdf\"" );
proc.waitFor(); proc.waitFor();
new File( System.getProperty( "user.home" ) + System.getProperty( "file.separator" ) + "report_ficha.pdf" ).delete(); if( !new File( System.getProperty( "user.home" ) + System.getProperty( "file.separator" ) + "report_ficha" + time + ".pdf" ).delete() )
{
System.err.println( "File: report_ficha" + time + ".pdf - NOT DELETED" );
}
} }
else else
{ {
//System.out.println( "/usr/bin/open \"" + System.getProperty( "user.home" ) + System.getProperty( "file.separator" ) + "report_ficha.pdf\"" ); //System.out.println( "/usr/bin/open \"" + System.getProperty( "user.home" ) + System.getProperty( "file.separator" ) + "report_ficha.pdf\"" );
try{ try{
proc = Runtime.getRuntime().exec( new String[]{"/usr/bin/open", "" + System.getProperty( "user.home" ) + System.getProperty( "file.separator" ) + "report_ficha.pdf" } ); proc = Runtime.getRuntime().exec( new String[]{"/usr/bin/open", "" + System.getProperty( "user.home" ) + System.getProperty( "file.separator" ) + "report_ficha" + time + ".pdf" } );
} }
catch( Exception ex ) catch( Exception ex )
{ {

Loading…
Cancel
Save