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

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -