Hi,
i'm generating PDF documents from a PDF document pattern, passing it
through a ZipOutStream. The ZipOutStream is passed through
the myServletOutputStream.
The problem is : instanciating a new PdfReader ( i = 1 ), i've got the
exception : *PDF header signature not found.*
Result : a ZIP file with only 1 file size : 0 bytes !!!
What's going wrong ? Thx for your answer !!!
My code :
try {
ZipOutputStream zos = new ZipOutputStream( myServletOutputStream );
for ( int i = 0; i < myVector.size(); i++ ) {
myObject= (MyObject)myVector.get(i);
ze = new ZipEntry( "C_"+myObject.getNumero()+".pdf" );
zos.putNextEntry(ze);
reader = new PdfReader(myPdfPattern);
stamp = new PdfStamper(reader, zos );
stamp.getWriter().setCloseStream(false);
myForm = stamp.getAcroFields();
[[.. code filling form ..]]
int npages = reader.getNumberOfPages();
for ( int j = 0; j < npages; j++ )
zos.write(reader.getPageContent(j+1));
stamp.close();
zos.closeEntry();
}
zos.close();
} catch (Exception e) {
e.getMessage();
}
_________________________________________________________
This message is for the designated recipient only and may contain privileged or
confidential information. If you have received it in error, please notify the
sender
immediately and delete the original. Any other use of the email by you is
prohibited
P Por favor, antes de imprimir este e-mail piense si es necesario hacerlo: El medio ambiente es cosa de todos.
Please consider the environment before printing this email.
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/