Skip to content

Instantly share code, notes, and snippets.

@nicholastay
Created June 17, 2019 12:40
Show Gist options
  • Save nicholastay/744c710ed81328525dcf1810f970ea99 to your computer and use it in GitHub Desktop.
Save nicholastay/744c710ed81328525dcf1810f970ea99 to your computer and use it in GitHub Desktop.
Quickly read/convert MS Office generated documents as a PDF in Windows (LibreOffice + SumatraPDF)
@echo off
SET OUTPUTPATH=%USERPROFILE%\Desktop
if exist "%OUTPUTPATH%\%~n1.pdf" goto launch
echo Converting to PDF, saving to defined output path...
cd /D "%OUTPUTPATH%"
soffice --convert-to pdf %1 --headless
:launch
start SumatraPDF "%OUTPUTPATH%\%~n1.pdf"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment