I have the following code. I'm trying to get instance of pdf pages as image, resize the images and then added back to the document.
for (int i=1; i<=reader.getNumberOfPages();i++){
PdfImportedPage page = writer.getImportedPage(reader, i);
Image image = Image.getInstance(page);
float currentWidth = image.getWidth();
float currentHeight = image.getHeight();
image.scalePercent(50);
float newWidth = image.getWidth();
float newHeight = image.getHeight();
}
I creates float variables to find the width and height of the image before and after scale. here is the problem i'm facing. the current and new height adn width are exactly the same. they don't change.
Can anyone help?