Jump to content

Convert Web Pages to PDF


Recommended Posts

This workflow uses the open-source command line tool wkpdf to convert web pages to PDF. You will need to install wkpdf first, which takes about 30 seconds. Directions can be found here under the installation heading: http://plessl.github.com/wkpdf/

 
Once wkpdf is installed, the workflow provides two options. First, grab the current page from Safari as is and output to a PDF on your Desktop. Use keyword "pdf" followed by the name you want your PDF file to have. The following example will create a PDF of the current page called Interesting Article.pdf
 
pdfconvert.png
 
 
The second option processes the page with Instapaper mobilizer for better reading before creating the PDF. Use keyword "ipdf" followed by the file name. The following example will create an Instapaper-ized PDF of the current page called Interesting Article Readable.pdf
 
ipdfconvert.png
 
 
Download here: http://d.pr/f/bpSD
Link to comment

waffles_n I would recommend that you add the info about "wkpdf" being a requirement to the readme feature of your extension... I grabbed it with alfpt and had no idea why is was not working correctly. Thank you again for sharing but that could save a lot of people a lot of headache. Cheers on the great workflows lately!

Link to comment

waffles_n I would recommend that you add the info about "wkpdf" being a requirement to the readme feature of your extension... I grabbed it with alfpt and had no idea why is was not working correctly. Thank you again for sharing but that could save a lot of people a lot of headache. Cheers on the great workflows lately!

 

Good idea. Unfortunately, I don't have the scripting skills necessary to deal with checking for and installing wkpdf from within the workflow itself. I've added installation instructions to the readme portion of the workflow. Download link and Alfred repo versions updated.

Link to comment
  • 1 month later...

9:06 p.m. (MST)

 

This is not working for me.

 

I get the Growl Notification, but no file appears on my Desktop.

 

Cheers.

 

Did you install the wkpdf command line tool? The instructions are included in the readme section of the workflow description. Here they are (copied and pasted from the readme) for reference:

 

 

Note: This workflow requires that you have wkpdf installed. Fire up a Terminal session and follow these steps:
 
1. Update RubyGems if necessary (wkpdf requires version 1.3.3 or later; if you're not sure, just run the updater)
 
sudo gem update --system
 
2. Install wkpdf
 
sudo gem install wkpdf
 
That's all! You can update wkpdf to the latest version at any time with
 
gem update wkpdf
Link to comment

Pretty neat and useful :-). Saves time from the normal printing to PDF route

I made two modifications so that

  • this now works with both Safari and Chrome
  • checks if wkpdf is installed first, if not prompt user with a message to check the readme
Here is the updated one - hope this helps...

Cheers!

Edited by Benzi
Link to comment

Did you install the wkpdf command line tool? The instructions are included in the readme section of the workflow description. Here they are (copied and pasted from the readme) for reference:

 

 

Note: This workflow requires that you have wkpdf installed. Fire up a Terminal session and follow these steps:
 
1. Update RubyGems if necessary (wkpdf requires version 1.3.3 or later; if you're not sure, just run the updater)
 
sudo gem update --system
 
2. Install wkpdf
 
sudo gem install wkpdf
 
That's all! You can update wkpdf to the latest version at any time with
 
gem update wkpdf

Yes:

 

 

"Successfully installed wkpdf-0.6.10-universal-darwin
1 gem installed
Installing ri documentation for wkpdf-0.6.10-universal-darwin...
Installing RDoc documentation for wkpdf-0.6.10-universal-darwin…"
 
How can I check that wkpdf is "working" ?
 
Howard
Link to comment
  • 4 weeks later...

It works great with Chrome but it opens up Safari too.

Is there anyway to make it work without opening Safari ?

 

Some great features would also be to insert the created file in an evernote Note and/or to specify (for each file) where to save the PDF created.

Edited by Chezstef
Link to comment
  • 7 months later...
Trying to get this to work in Mavericks but my knowledge of these things is very limited.

I installed WKPDF as described in the posts, however it complains that it can’t find Rubycocoa library.

There appears to be a problem with wkpdf (or Rubycocoa) with Ruby 2.0 in Mavericks.

I then downloaded and installed a dmg of rubycocoa that says it works with 10.9. Still not working and still complaining that it can’t find the Rubycocoa library.

I then tried to install WKPDF in to

“System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby” using the Terminal command

“sudo gem install wkpdf --install-dir /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/“

and altered the script where it calls WKPDF to:

System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby/wkpdf

It now no longer gives the Rubycocoa library error and appears to be working but I get no output on the desktop.

It may be significant that the Growl message I now get just says “PDF Printing” and does not echo the PDF title at all.

 

I also tried “sudo gem update --install-dir /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/” in Terminal.

 

Has anybody got this working in Mavericks?

Maybe I have made a mistake in the way I have tried to install, my knowledge of this is limited and I have just tried these by examples I have found browsing the web?

I would like to use WKPDF because I like how it can print a webpage without pagination.

Help please.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...