One can solve this problem with LibreOffice 24.2.7.2 420(Build:2).
On the command line type the following
libreoffice --convert-to pdf document.pages
This will create a file called document.pdf on the same folder. You can also do a batch conversion by using wildcard characters for filename matching as follows
libreoffice --convert-to pdf *.pages
In any case please verify with the documentation of the libreoffice CLI in case of any updates for changes or type libreoffice --help