Free PDF Reader on Mac

I was talking to my wife earlier this year about all the reading that we have to do in school. We have books, articles, journals, and tother pdfs that we need to read for our classes. Victoria had a lot in just her employment law class. I started looking into PDF Readers, it isn't a hard task to have a simple extract text from a PDF and then read it. It seemed to me that a very basic version of this could easily be implemented on our computer. 

I started looking into open-source TTS models and looking at all types of technology. Then, I realized that I need to iterate. What is the bare minimum that I need to do to get something working. Once I get there, I can figure out what can be done to improve the system.

I have used the Mac shortcuts and the Automator a few times before to define certain tasks on my local macbook. I figured that I could start there. Turns out there are built in functions that already allow me to access the native TTS system, so I built a Quick Action to read me a PDF. 

Step 1: Create a Quick Action

I choose a quick action because I wanted to be able to trigger this automation using the quick menu in finder. Under the Quick Actions tab I can see all the ones that I have made that relate the the file type that the Quick Action workflow receives as an input.


This is the context menu of PDF files in finder.  

Now, we need to actually create the workflow. Open up the Automator app and choose the Quick Action.


Step 2: Add our actions

The next step is to simply add actions to read our PDF. I first added the action Extract PDF Text. This simply inputs a PDF file and saves the output to a new .txt file and variable. So I created a variable in Automator and saved the text file as this variable. 

The second action is to get the value of this variable. I tried to skip this step and send the text file directly into the speak text action, but it spoke the name of the file and not the contents of the text file, so this is me getting creative. After that, we need to open the text file. Note: you can set the application that opens the text document as TextEdit, but it does come installed as the default, so leaving the setting as the default application should be ok. Then next step is to get the contents of the forward-most TextEdit Document. This is not my ideal workflow, but like I said, I hope to iterate on this and improve it, but this is a basic, working solution.

The last action is to simply speak the text that is passed from the get contents action. You can set the TTS voice that will be used, or you can check the box Options>Show this action when the workflow runs. This will prompt the user for a voice to read in instead of just playing the text automatically.



 One major limitation of this is that you can't pause resume the speaking once you start the workflow, so this is easily fixed by replacing the last action with the Text to Audio File action and I prefer mp4 file formats, so I added the action Encode to MPEG Audio.



Now, for testing. If you set up the input to the workflow so that it receives PDF files in Finder, then in Finder, you should be able to right click for the context menu and see under Quick Actions your new action. Clicking on that activated the workflow and should prompt you for a voice and either start reading or create a mp4 for you to play and pause.

Next Steps:

I would love to get something like this working with a neural voice. The TTS voices that are preinstalled on the mac are still very robot-like. I like this as a quick and dirty solution for getting a quick, free TTS system to read my PDFs.

Let me know in the comments if you know of a better way to do the workflow, I don't have a lot of experience with them and I don't know all the tricks. 

Comments

Popular posts from this blog

Phonetic Posteriorgrams

The Hard Part About Speech

Robotic Voices and Speech Synthesis: Experiments with Unit Selection