2025年7月11日金曜日

LibreOfficeでPDFファイルからMicrosoft Officeのファイルを出力する

LibreOfficeには、ファイルを別の形式に変換して出力する機能があります。
PDFファイルをMicrosoft Officeのファイル形式に変換するには、下記のようなコマンドで変換することができます。

実行するコマンド

LibreOffice Impressで読み込み、Microsoft PowerPointに変換したファイルを出力します。
"%ProgramFiles%\LibreOffice\program\soffice.com" --infilter="impress_pdf_import" --convert-to "pptx:Impress MS PowerPoint 2007 XML" "example.pdf"

コマンド実行後のコンソール出力例

convert C:\example.pdf as a Impress document -> C:\example.pptx using filter : Impress MS PowerPoint 2007 XML
LibreOffice Impressを例にしましたが、フィルターを指定すると、他のファイル形式での出力が可能になります。