ALYB
March 7, 2023, 3:12pm
#1
Took me some time to get this right so I'm happy to share this!
Convert Ms Word document 'input.docx' to pdf via LibreOffice Writer.kmmacros (1.7 KB)
BTW: Not sure if Pandoc allows docx to pdf conversion too...
macOS Big Sur 11.7.4
LibreOffice 7.5.0.3
2 Likes
FWIW pandoc can indeed write out to PDF at the command line:
Pandoc - Creating a PDF
but, on this system at least, doing that from a Keyboard Maestro Execute Shell Script action seems to get frustrated by sandboxing restraint of process spawning when pandoc internally delegates the PDF generation to Latex.
In short, your technique seems a good match for Keyboard Maestro workflows.
ALYB
March 7, 2023, 8:39pm
#3
I would have to compare the quality of the pdfs that Pandoc creates with that of LibreOffice.
BTW: My whole workflow to convert a folder with docx files to 1 pdf for reference now is:
Merge DOCX Files in TO_MERGE folder on Desktop to REF.PDF.kmmacros (7.5 KB)
FWIW, you can take a look at this for another option (using Pandoc):
Recently, someone told me that it was possible to convert PDF using Pandoc Haskell libraries. Using the following macro, and plug-in, we can accomplish it with KM.
Convert .docx file to PDF using Pandoc Haskell libraries.kmmacros (9.0 KB)
[Keyboard Maestro Export]
Expand disclosure triangle to see "haskell" source {-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Control.Monad
import Control.Monad.Catch
import Control.Monad.IO.Class
impo…