Quick actions convert to DOC/DOCX to a PDF file?

As the title says, I'm trying to use the quick actions feature, which would speed up my workflow a little bit, to convert DOCs/DOCXs files to PDF documents. I'm not really finding an easy solution, so I'm thinking it probably doesn't work that way, but I wanted to come here and double check just to make sure. Thanks!

MacBook Pro 15″, macOS 10.15

Posted on Jun 3, 2020 3:54 AM

Reply
7 replies

Jun 3, 2020 5:27 AM in response to G. Thorson

Short of Apple embedding proprietary document rasterizers into the Quick Action, there would be no way for it to convert the document into PDF. The files it can convert to PDF are simple to embed because there is only minimal translation to "document" format, and it will not change at the whim of a developer.


For a complex document format like Word or Excel, it needs a formatting engine that can translate the document "code" into a formatted document, then encode that into PDF format. In general, that translation is proprietary, though I think Microsoft uses an open format. That would still require a large code base to be maintained and have to react to every change in the third-party software document formats.


Microsoft could provide a Quick Action, if they wanted to do so. There are various third-party developers that provide Quick Actions.

Jun 3, 2020 8:21 AM in response to G. Thorson

You would need a Quick Action that knows how to convert .doc/.docx into PDF, and that requires opening the Word document in an application that knows how to convert it into PDF. The following Quick Action will convert Word .doc/x to PDF in the same location as the Word document.


  1. Install LibreOffice into your Applications folder.
    1. Right/control-click on the /Applications/LibreOffice icon and choose Open. It will verify, and choose Open on the next dialog. Quit LibreOffice when it opens.
  2. Launch Automator, and choose Quick Action for the Automator document type.
    1. Workflow receives current [ documents ] in [ Finder ]
    2. All other Quick Action settings are unchanged
  3. In the Automator Utility library, drag and drop the Run Shell Script action into the larger workflow window
    1. Shell /bin/bash
    2. Pass input: as arguments
    3. Remove any content in the existing Run Shell Script action
  4. Copy/paste the following shell script into the Run Shell Script action
  5. Save Quick Action with name Word to PDF
  6. System Preferences : Extensions : Finder : [√] Word to PDF
  7. In Finder, you can now right/control click on a Word document and select Quick Actions ▸ ⚙︎ Word to PDF.


Script:


# For one or multiple selected document(s) (e.g. .doc/x, .rtf, etc.) in the Finder, convert to PDF
# in the original file location. One can explicitly set parentdir to the full POSIX path
# of the intended PDF output directory, rather than the original file location.

function app_test {
	# test if the application is installed and return 1 if false condition
	[[ -e /Applications/LibreOffice.app ]] && return 0 || return 1
}

# test for application installation. Warn user if it is not found, and exit Service workflow.
[[ app_test -eq 0 ]] || ( /usr/bin/osascript -e 'display dialog \"LibreOffice is not installed.\"';exit 1 )

for f in "$@"
do
	# if the file is zero length or non-existent then ignore
   [[ -s $f ]] || continue

	# The output directory is original file location
	parentdir="$(dirname "${f}")"
   /Applications/LibreOffice.app/Contents/MacOS/soffice --headless --convert-to pdf --outdir "${parentdir}" "${f}"

done
exit 0


Jun 4, 2020 7:43 PM in response to kcpaul

As LibreOffice Writer is a Word clone, it will have far better capability in converting any .docx to PDF than pandoc which relies on external installations of full TeX, pdfroff, or wkhtmltopdf. See the Pandoc online manual section for Creating a PDF for the details of this minutiae.


Most users can cope with a LibreOffice installation, but the rest will not want to install 8GB of MacTex, or even want to deal with homebrew.


I have Pandoc here and use it frequently where its strengths permit. I also happen to have the full MacTeX distribution installed, as well as wkhtmltopdf via homebrew.

Jun 3, 2020 4:34 AM in response to QuickTimeKirk

I know that, but if you'd look into my question a bit more, the quick actions option allows you to do it straight from the desktop with most files that can convert into PDF, jpgs, txt files, I was just wondering if there was a way to do this from the quick actions menu and not have to go all the way into the print menu, which takes a bit longer. They added this feature in MacOSX Mojave, so it's fairly new. Thanks for the quick reply btw. :)

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Quick actions convert to DOC/DOCX to a PDF file?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.