Convert a Multi-Page word file to PNG using LibreOffice API in JAVA

How to convert a Multi-Page Text file to PNG, for example:- I have a Word document of 5 pages and I want to convert that into PNG. By default, it’s giving a PNG of only 1st page. How to get the PNG file for ith page using LibreOffice.

Also, I’m not able to generate multiple PNGs for multi-page word files using the LibreOffice Application

I used the PageRange filter like this, but it does not work, it’s also giving the PNG only for 1st page.

soffice --convert-to 'png:writer_png_Export:{"PageRange":{"type":"string","value":"2-"}}' test.odt


conversionProperties[0] = new;
conversionProperties[0].Name = "FilterName";
conversionProperties[0].Value ="writer_png_Export";

conversionProperties[1] = new;
conversionProperties[1].Name = "PageRange";
conversionProperties[1].Value ="2-";