My code is below and i simplify it to just add new page to the PdfCopyField 
variable but everytime i go over 5 page it tells me the pdf file is damaged. 
  Did my code mess it up or is there a limite to the number of page i can 
copy to PdfCopyField?
Thank you,

Code:
try{
PdfCopyFields copy = new PdfCopyFields(baos);
PdfReader reader2 = null, reader = new PdfReader("e:/guide.pdf");
int count = 0;
while (count <= 3){
                reader2 = new PdfReader("e:/Webs/walton/ICF.pdf");
                stamp1 = new PdfStamper(reader2, baos2);
                stamp1.close();
                reader.close();
                reader2 = new PdfReader(baos2.toByteArray());
                copy.addDocument(reader2);
                count++;
}
copy.close();


// WRITE TO BROWSER
response.setContentType("application/pdf");
response.setContentLength(baos.size());

baos.writeTo(response.getOutputStream());

}catch (Exception ex){
        out.print(ex.getMessage());
}
out.clear();
out = pageContext.pushBody();

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today - it's FREE! 
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/


-------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to