What i am doing is create a new document (doc 1) coping 3 times another document (doc 2) and it's done prefectly, but when i want delete (manually) both documents, the first one is deleted but de second one (doc 2) give me an error and don't let me delete it. The error says something like "possibly the archives of origin or destiny are in use"

This's the my code:

int contpag = 0;
String outFile = fichero_CaraA_3;
document = null;
PdfCopy writer_C = null;
while (contpag < 3) {
String ficherito="./data/Domino/html/tmp/ENUtxt.pdf";
PdfReader reader = new PdfReader(ficherito);
int n = reader.getNumberOfPages();
System.out.println("There are " + n + " pages in " + fichero_CaraA);
if (contpag == 0) {
document = new com.lowagie.text.Document(reader.getPageSizeWithRotation(1));
writer_C = new PdfCopy(document, new FileOutputStream(outFile));
document.open();
}
PdfImportedPage page;
for (int i = 0; i < n; ) {
++i;
page = writer_C.getImportedPage(reader, i);
writer_C.addPage(page);
//System.out.println("Processed page " + i);
}
//PRAcroForm form = reader.getAcroForm();
//if (form != null)
// writer_C.copyAcroForm(reader);
contpag++;


               }
               document.close();


Someone can help me?


_________________________________________________________________
Descubre el mayor cat�logo de coches de la Red en MSN Motor. http://motor.msn.es/researchcentre/




-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to