int len = reader.getNumberOfPages();
PdfStamper stamp = new PdfStamper(reader, os);
if(len >0){
if(x==UNDEFINED || y==UNDEFINED) {
PdfImportedPage first = stamp.getImportedPage(reader, 1);
if(y==UNDEFINED)y=(first.getHeight()-img.getHeight())/2;
if(x==UNDEFINED)x=(first.getWidth()-img.getWidth())/2;
}
img.setAbsolutePosition(x, y);
//img.setAlignment(Image.ALIGN_JUSTIFIED); ration geht nicht anhand mitte
}