I have some problem using aspose.pdf. I want to insert a image in a pdf. I want that this image will have max width of 700. When i use the method “img1.setImageWidth(700)” it don’t do anything. All methods that modified image size don’t work. The only one that resize the image is the method “setImageScale” but i don’t want to use it. Even the method “getImageWidth” return always 0.
There is my code:
Pdf pdf1 = new Pdf();
Section sec1 = pdf1.getSections().add();
aspose.pdf.Image img1 = new aspose.pdf.Image(sec1);
sec1.getParagraphs().add(img1);
img1.getImageInfo().setFile(file_path);
img1.getImageInfo().setTitle("");
img1.getImageInfo().setImageFileType(ImageFileType.Jpeg);
final float maxMis=700;
if(img1.getImageWidth()>maxMis){
img1.setImageWidth(700);
}
obviously even if i delete the if and i set always the image Width to 700 it don’t works. The image don’t change width.
Can you help me?