I have been using LibreOffice in my rails app to convert my Doc to PDF using the command
/Applications/LibreOffice.app/Contents/MacOS/soffice --headless --convert-to pdf --outdir destination_path source_path/*.doc
in my rails app.
I planned to convert the entire Doc to PDF and display only a few pages of PDF, but it was not efficient to store the entire PDF only for preview purposes.
Is there a LibreOffice command or any other command that can help me export only the first few pages of Doc to PDF.