Command Line PDFs
Generating PDFs from HTML with Real Studio
Issue: 11.1 (November/December 2012)
Author: Marc Zeedar
Article Description: No description available.
Article Length (in bytes): 38,739
Starting Page Number: 34
RBD Number: 11107
11107project.zip Updated: Friday, January 4, 2013 at 2:50 PM
Related Link(s): None
Known Limitations: None
Excerpt of article text...
In RSD 6.3 (http://rsdeveloper.com/browse/6.3/6315/), I wrote on how to generate very basic PDFs using some Real Studio classes. In the subsequent issue, Christian Schmitz explained how to do it using his Monkeybread Plugins (http://rsdeveloper.com/browse/6.4/6411/), but it's not a topic we've covered in a while. There's nothing wrong with either approach, but I recently had a project where I wanted to generate PDFs from simple HTML files. I wanted more features than I had with the PDF classes approach, and I didn't want the complexity of plugins. It occurred to me that maybe there was a command-line app that would convert HTML to PDF.
A little searching online and I discovered wkhtmltopdf, a wonderful command-line tool that does just what I wanted. It's free (https://code.google.com/p/wkhtmltopdf/), multi-platform (it's built upon Apple's Webkit, the foundation for Apple's Safari web browser), and it works well. Using it isn't exactly easy, but it's more geeky than complicated, as the documentation is technical.
...End of Excerpt. Please purchase the magazine to read the full article.
Article copyrighted by REALbasic Developer magazine. All rights reserved.