For example, in the Standard library, in the My Macros section, you create a module XlsxToPDF and place a procedure there that looks something like this:
Option Explicit
Sub cvrtToPDF(sFileName As String)
Dim oSheets As Variant, oSheet As Variant
Dim i As Long
Dim oDoc As Variant
Dim oCursor As Variant, aTemp As Variant
Dim aArgs(0) As New com.sun.star.beans.PropertyValue
GlobalScope.BasicLibraries.LoadLibrary("Tools")
If Not FileExists(sFileName) Then Exit Sub
sFileName = ConvertToURL(sFileName)
aArgs(0).Name = "Hidden"
aArgs(0).Value = True
oDoc = OpenDocument(sFileName, aArgs)
If IsNull(oDoc) Then Exit Sub
oSheets = oDoc.getSheets()
For i = 0 To oSheets.getCount()-1
oSheet = oSheets.getByIndex(i)
oCursor = oSheet.createCursor()
oCursor.gotoEndOfUsedArea(True)
oCursor.VertJustify = 1 ' Hope that it will be enough`
Next i
aTemp = Split(sFileName, ".")
aTemp(UBound(aTemp)) = ".pdf"
sFileName = Join(aTemp,".")
aArgs(0).Name = "FilterName"
aArgs(0).Value = "calc_pdf_Export"
oDoc.StoreToUrl(sFileName,aArgs)
oDoc.close(True)
End Sub
And now the command line like
"<path to LibreOffice folder\program\soffice.exe" --headless --nologo "macro:///Standard.XlsxToPDF.cvrtToPDF("""full path\Battery AssemblyNewCheck (1).xlsx""")
will do the job