Fixed memory leak in the merge pdf method.

This commit is contained in:
Heng Sin Low 2011-02-07 18:13:58 +08:00
parent e460eca472
commit b82586bb82
1 changed files with 10 additions and 8 deletions

View File

@ -625,8 +625,10 @@ public final class AEnv
PdfContentByte cb = copy.getDirectContent();
for (int i = 1; i <= pages; i++) {
document.newPage();
copy.newPage();
PdfImportedPage page = copy.getImportedPage(reader, i);
cb.addTemplate(page, 0, 0);
copy.releaseTemplate(page);
}
}
document.close();