Bug 65431 - Not able to read image size and positions
Summary: Not able to read image size and positions
Status: RESOLVED INFORMATIONPROVIDED
Alias: None
Product: POI
Classification: Unclassified
Component: XWPF (show other bugs)
Version: 4.1.2-FINAL
Hardware: PC All
: P3 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-07-05 05:55 UTC by Sivaprakasam
Modified: 2021-10-09 16:29 UTC (History)
0 users



Attachments
This is the test file. (225.81 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2021-07-05 05:55 UTC, Sivaprakasam
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sivaprakasam 2021-07-05 05:55:22 UTC
Created attachment 37940 [details]
This is the test file.

Hi Team,

We are trying to read image from one word document and put that in an another document with same size and the same position. 

But we are unable to read image size and positions.

We need image width and height, and X,Y and any additional co ordinates(if needed).

I have attached sample document with image.

Thanks.
Comment 1 Sayi 2021-09-01 07:22:24 UTC
Hi,

You can read image by run.getEmbeddedPictures(), and use org.apache.poi.xwpf.usermodel.XWPFPicture#getWidth, #getDepth to get the image width and height.

If the picture is in anchor form, get x and y through w:drawing>wp:anchor>wp:positionH and w:drawing>wp:anchor>wp:positionV.
Comment 2 Dominik Stadler 2021-10-09 16:29:15 UTC
The previous commment hopefully answered this, of not please reopen the issue and provide more information/questions if necessary.