It was working but now I have rewrote some parts of the application and now I 
can't get pageEvent to work.

Nothing happens. 
System.out.println("test") in public void onEndPage()  should write something 
back?

MyPageEvents events = new MyPageEvents();
writer.setPageEvent(events);


class MyPageEvents extends PdfPageEventHelper {

/**
* After the content of the page is written, we put page X of Y
* at the bottom of the page and we add either "Romeo and Juliet"
* of the title of the current act as a header.
* @see 
com.lowagie.text.pdf.PdfPageEventHelper#onEndPage(com.lowagie.text.pdf.PdfWriter,
 com.lowagie.text.Document)
*/
public void onEndPage() 
{ 
flg_header=1;
System.out.println("test");

// börjar inläsningen av filen
try 
{

BufferedReader in = new BufferedReader(new FileReader(mall));

while(!line.trim().startsWith("</header>"))
{
line=in.readLine();

// TABELL
if(line.trim().startsWith("<table>"))
getTable();

// REKTANGEL
if(line.trim().startsWith("<rectangle>"))
getRectangle();

try {

// IMG
if(line.trim().startsWith("<image>"))
document.add(getImage());

// TEXT
if(line.trim().startsWith("<text>"))
getText();
}
catch(DocumentException de) {
System.err.println(de.getMessage());
}
}

in.close();
}
catch(IOException ioe) {
System.err.println(ioe.getMessage());
}

flg_header=0;
}
}

      Mvh, Boris 
     
      Supportärenden, önskemål eller förslag till ändringar vill vi ha per 
epost till: [EMAIL PROTECTED] 
     
      Boris Matisic   Voice +4642-16 35 80  
      Qnab System AB   Fax +4642-15 16 85 
      Apelvägen 9   Email [EMAIL PROTECTED] 
      S-260 40 VIKEN   Support [EMAIL PROTECTED] 
      Sweden   Info [EMAIL PROTECTED] 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.409 / Virus Database: 268.15.6/566 - Release Date: 2006-12-03
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/

Reply via email to