LibreOfficeでExcelファイルをPDFに変換する(Linux・コマンドライン)

LinuxコマンドラインLibreOfficeを使ってExcelファイルをPDFに変換する

下記の例ではカレントディレクトリに「test.pdf」が作られる

$ libreoffice --convert-to pdf test.xlsx

「--outdir」オプションで出力先ディレクトリを指定できる
下記の例では「output」ディレクトリに「test.pdf」が作られる

$ libreoffice --convert-to pdf --outdir output test.xlsx

ワイルドカードを使って複数ファイルをまとめて処理することもできる
下記の例では「output」ディレクトリに「test1.pdf」、「test2.pdf」、「test3.pdf」が作られる

$ ls
output  test1.xlsx  test2.xlsx  test3.xlsx
$ libreoffice --convert-to pdf --outdir output *.xlsx