How would I open a web page as pdf and open that pdf in an app?

I am trying to speed up my usual method which is to open the URL in a browser → print as pdf → go to the folder containing the pdf → open the PDF in highlights (a PDF annotation app).

Let's say that I would first have saved the URL to the clipboard so that the solution is not browser specific. I am clueless as to what the next steps would be.

thank you very much

1 Like

I'm not sure how much you can trim it down: You have to convert the web page content to a PDF, and the Print menu is one of the easiest and quickest ways to do that. Alternatively, you could probably combine curl and some unix utility like wkhtmtopdf to grab the web page and convert it to PDF.

I think the simplest solution would just be to write a macro to automate the steps you currently take—at least based on what you've described thus far.

-rob.

1 Like

A little simplification of the process... If a specific folder is always used for where PDFs are saved, and if PDFs are set to always open using the Highlights app, it looks like this macro will automatically open new PDFs added to the folder.

Edit: And if you have the Hazel app it can be configured to do this, too.

2 Likes

thank you very much @NaOH and @griffman

I just remembered an old trick that may help. I'm on an older macOS, but there exists

~/Library/PDF Services

and if an alias to an app is placed in the folder, then the alias presents itself as an option in the Print > PDF menu of apps (like Safari). It successfully worked here (10.14 Mojave), opening a PDF of a web page in the app for which I'd added an alias.

Do note the PDF was not yet saved outside of a system temp folder, so if it works on newer OSes then proper saving may be the ideal first step upon PDF creation.

NOTE: I initially specified the incorrect folder (Printing Services) instead of PDF Services.

3 Likes

Thanks very much.

Works fine with PDF Services (arrow below) as you suggested. thanks for taking your time to test.

A constant recurrent irritant is going through the printing interface every time I print (nothing to do with print services and my question above). I sometimes print color other times B&W, different page size, recto or both sides etc

As far as I understand KM is of very limited help aside from using arrows and tabs.

Have you found a way to create macros for different configurations ?

Not a Keyboard Maestro solution, but you can save a current settings as a Preset and call it up when you need to print the same again.

1 Like

Thank you for your suggestion. Yes, I use presets a lot and I should have explained myself better : in my printing macros, I tediously use use tabs, arrow, enter etc in the most basic primitive ways to select a preset. I was wondering if there was a quick and straightforward way to give the command print using xyz preset , the same way one would use a template in many apps.

Yes, I have often wondered the same thing but I've never found a reliable way.

1 Like

In Safari, you can use File > Export as PDF... Then you do not have to worry about clashes with your print setup.

The results will be a little different. I prefer how pages are rendered when that method is used. For a start, the PDFs are not divided into pages.

Export as PDF... is also available in another browser that uses the WebKit engine, Orion. It does it faster than Safari and more reliably. At least on slower Macs, you may find that Safari will let you close the tab when its contents are (still) being rendered as PDF, but then complain that you have done so. :person_facepalming::green_apple::roll_eyes:.

2 Likes

Nice. I knew about this option, but I never noticed the differences between Export and Print as PDF. Good to know!

2 Likes

I do thanks, I didn't realize it could do that.

1 Like

I just had success with a quick test. I created two printing presets. Then I added keyboard shortcuts for them in System Preferences > Keyboard > Shortcuts > App Shortcuts > All Applications. I made the preset titles simple and the shortcuts distinct.

Preset 1 got shortcut Command-Option-Control-1

and

Preset 2 got shortcut Command-Option-Control-2

After using Command-P to bring up the print dialog both of these shortcuts worked.

Also note that my earlier suggestion to make exporting a PDF to an app can receive a keyboard shortcut in this same way (through System Preferences or Settings). That means a sequence of keyboard shortcuts could

  1. Invoke the Print command
  2. Choose the desired printing preset
  3. Export a PDF to a specific app
2 Likes

works perfectly. thanks very much !