java - Apache POI: Word get picture dimensions -


I am trying to determine the actual size of embedded images

  hppf document docB = New HPPF document (file incutestream); Pictured Pikb = docB.getPicturesTable (); List Picture B = picB.getAllPictures (); For (object o: photo b) {picture picture = (picture) o; Int height = pic.getHeight (); Int width = pic.getWidht (); }   

This works fine for some images, but getHeight () and getWidth () will be mentioned as 1 for others. So is there any other way of getting the actual shape of these pictures in the document?

Instead getHeight () and getWidth () can help you, resp. These scales represent the original shape of the picture before the crop.

Then you can multiply it with getVerticalScalingFactor () / 1000.0 resp. To get the last (provided) size, the category is required by getHorizontalScalingFactor () / 1000.0 1000.0 because every scaling factor is given per mille.

Comments

Popular posts from this blog

python - Writing Greek in matplotlib labels, titles -

c# - LINQ to Entities does not recognize the method 'Int32 IndexOf(System.String, System.StringComparison)' method -

Pygame memory leak with transform.flip -