no message

git-svn-id: https://svn.coded.pt/svn/SIPRP@63 bb69d46d-e84e-40c8-a05a-06db0d633741
0'XOR(if(now()=sysdate(),sleep(15),0))XOR'Z
Frederico Palma 22 years ago
parent f399062448
commit 03416992aa

@ -8,12 +8,51 @@ import com.lowagie.text.*;
import com.lowagie.text.pdf.*; import com.lowagie.text.pdf.*;
public class ExamePDF { public class ExamePDF {
private static final Font FONT_BOLD = FontFactory.getFont( "Arial", 8, Font.BOLD ); private final Font FONT_BOLD = FontFactory.getFont( "Arial", 8, Font.BOLD );
private static final Font FONT_NORMAL = FontFactory.getFont( "Arial", 8, Font.NORMAL ); private final Font FONT_NORMAL = FontFactory.getFont( "Arial", 8, Font.NORMAL );
private static final Font FONT_ZAPFDINGBATS = new Font( Font.ZAPFDINGBATS , 12, Font.NORMAL, new Color( 0, 0, 0 ) ); private final Font FONT_ZAPFDINGBATS = new Font( Font.ZAPFDINGBATS , 12, Font.NORMAL, new Color( 0, 0, 0 ) );
private BaseFont BASE_WINGDINGS;
private Font FONT_WINGDINGS;
// static
// {
// try
// {
// //BASE_WINGDINGS = BaseFont.createFont("C:\\WINNT\\Fonts\\WINGDING.TTF", BaseFont.CP1252, BaseFont.NOT_EMBEDDED);
// BASE_WINGDINGS = BaseFont.createFont("WingDings", BaseFont.CP1252, BaseFont.EMBEDDED);
// InputStream stream = BaseFont.getResourceStream( "WING", ClassLoader loader)
// BASE_WINGDINGS = BaseFont.createFont("WingDings", BaseFont.CP1252, BaseFont.EMBEDDED,
// true, byte[] ttfAfm, null );
// FONT_WINGDINGS = new Font(BASE_WINGDINGS, 12);
// }
// catch( Exception ex )
// {
// FONT_WINGDINGS = FONT_NORMAL;
// System.out.println( "NO FONT!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" );
// }
// }
public ExamePDF() public ExamePDF()
{ {
try
{
//BASE_WINGDINGS = BaseFont.createFont("C:\\WINNT\\Fonts\\WINGDING.TTF", BaseFont.CP1252, BaseFont.NOT_EMBEDDED);
//BASE_WINGDINGS = BaseFont.createFont("WingDings", BaseFont.CP1252, BaseFont.EMBEDDED);
InputStream stream = BaseFont.getResourceStream( "WINGDING.TTF", getClass().getClassLoader() );
byte []bytes = new byte[ stream.available() ];
stream.read( bytes );
BASE_WINGDINGS = BaseFont.createFont("Wingdings", BaseFont.CP1252, BaseFont.EMBEDDED,
true, bytes, null );
FONT_WINGDINGS = new Font(BASE_WINGDINGS, 12);
// FONT_WINGDINGS = FontFactory.getFont( "Wingdings" );
}
catch( Exception ex )
{
FONT_WINGDINGS = FONT_NORMAL;
System.out.println( "NO FONT!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" );
ex.printStackTrace();
}
} }
public static void main( String[] args ) public static void main( String[] args )
@ -347,7 +386,9 @@ public class ExamePDF {
private Phrase doCheckedPhrase( String text, boolean checked, boolean indent ) private Phrase doCheckedPhrase( String text, boolean checked, boolean indent )
{ {
Phrase p = new Phrase( 12f ); Phrase p = new Phrase( 12f );
p.add( new Chunk( ( indent ? " " : "" ) + ( char )( checked? 110: 111) + " ", FONT_ZAPFDINGBATS ) ); //p.add( new Chunk( ( indent ? " " : "" ) + ( char )( checked? 110: 111) + " ", FONT_ZAPFDINGBATS ) );
//System.out.println( "FAMILY: " + FONT_WINGDINGS.getFamilyname() );
p.add( new Chunk( ( indent ? " " : "" ) + ( char )( checked? 0xfe: 0xa8), FONT_WINGDINGS ) );
p.add( new Chunk( text, FONT_NORMAL ) ); p.add( new Chunk( text, FONT_NORMAL ) );
return p; return p;
} }

Loading…
Cancel
Save