pjfanning commented on code in PR #861:
URL: https://github.com/apache/poi/pull/861#discussion_r2231531793


##########
poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFRun.java:
##########
@@ -1363,6 +1365,175 @@ public XWPFPicture addPicture(InputStream pictureData, 
PictureType pictureType,
         }
     }
 
+    /**
+     * Adds a picture to the run. This method handles
+     * attaching the picture data to the overall file.
+     *
+     * @param pictureData The raw picture data
+     * @param pictureType The type of the picture, eg {@link 
Document#PICTURE_TYPE_JPEG}
+     * @param width       width in EMUs. To convert to / from points use 
{@link org.apache.poi.util.Units}
+     * @param height      height in EMUs. To convert to / from points use 
{@link org.apache.poi.util.Units}
+     * @param isBehindDoc      The "behindDoc" attribute of the CTAnchor.
+     * @param x      X Position Offset in EMUs. To convert to / from points 
use {@link org.apache.poi.util.Units}
+     * @param y      Y Position Offset in EMUs. To convert to / from points 
use {@link org.apache.poi.util.Units}
+     * @throws InvalidFormatException If the format of the picture is not 
known.
+     * @throws IOException            If reading the picture-data from the 
stream fails.
+     * @see org.apache.poi.xwpf.usermodel.Document#PICTURE_TYPE_EMF
+     * @see org.apache.poi.xwpf.usermodel.Document#PICTURE_TYPE_WMF
+     * @see org.apache.poi.xwpf.usermodel.Document#PICTURE_TYPE_PICT
+     * @see org.apache.poi.xwpf.usermodel.Document#PICTURE_TYPE_JPEG
+     * @see org.apache.poi.xwpf.usermodel.Document#PICTURE_TYPE_PNG
+     * @see org.apache.poi.xwpf.usermodel.Document#PICTURE_TYPE_GIF
+     * @see org.apache.poi.xwpf.usermodel.Document#PICTURE_TYPE_DIB
+     * @see org.apache.poi.xwpf.usermodel.Document#PICTURE_TYPE_SVG
+     * @see #addPicture(InputStream, PictureType, String, int, int, boolean, 
int, int)
+     */
+    public XWPFPicture addPicture(InputStream pictureData, int pictureType, 
String filename, int width, int height, boolean isBehindDoc, int x, int y)
+            throws InvalidFormatException, IOException {
+        return addPicture(pictureData, PictureType.findByOoxmlId(pictureType), 
filename, width, height, isBehindDoc, x, y);
+    }
+
+    /**
+     * Adds a picture to the run. This method handles
+     * attaching the picture data to the overall file.
+     *
+     * @param pictureData The raw picture data
+     * @param pictureType The {@link PictureType} of the picture
+     * @param width       width in EMUs. To convert to / from points use 
{@link org.apache.poi.util.Units}
+     * @param height      height in EMUs. To convert to / from points use 
{@link org.apache.poi.util.Units}
+     * @param isBehindDoc      The "behindDoc" attribute of the CTAnchor.
+     * @param x      X Position Offset in EMUs. To convert to / from points 
use {@link org.apache.poi.util.Units}
+     * @param y      Y Position Offset in EMUs. To convert to / from points 
use {@link org.apache.poi.util.Units}
+     * @throws InvalidFormatException If the format of the picture is not 
known.
+     * @throws IOException            If reading the picture-data from the 
stream fails.
+     */
+    public XWPFPicture addPicture(InputStream pictureData, PictureType 
pictureType, String filename, int width, int height, boolean isBehindDoc, int 
x, int y)

Review Comment:
   can you add `@since POI 5.5.0`?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
For additional commands, e-mail: dev-h...@poi.apache.org

Reply via email to