// add new page to kids entry in the pages dictionary
COSArray kids = (COSArray) pages.getItem(COSName.getPDFName("Kids"));
kids.add(destination.createObject(page));
// and increase count
COSNumber count = (COSNumber) pages.getItem(COSName.COUNT);
pages.setItem(COSName.COUNT, new COSInteger(count.intValue() + 1));
}
/**
* concat two pdf documents and fill fields in both templates
* this is a bit tricky as one has to rename the fields if we use the same template two times.
* here we don't user a clever algorithm to create dynamic fieldnames - this is left to the user..