byte[] bytes = IOUtils.toByteArray(input);
Image image = Image.getInstance(bytes);
float factor = layoutContext.getDotsPerPixel();
image.scaleAbsolute(image.getPlainWidth() * factor, image.getPlainHeight() * factor);
FSImage fsImage = new ITextFSImage(image);
if(cssHeight > -1 && cssWidth > -1) {
fsImage.scale(cssWidth, cssHeight);
}
return new ITextImageElement(fsImage);
} catch (Exception e) {
Log.error(Geonet.GEONETWORK, "Error writing metadata to PDF", e);