How to make money developing with the D.R. API

How to make money developing with the D.R. API

DocRaptor is a killer new web service that makes generating BEAUTIFUL PDFs as easy as writing HTML. The raptor also does Excel Documents, however for the purpose of this post I’m going to focus purely on the PDF side of things.

Many many years ago, I started a PDF Book Printing service called PrintFu and needed the ability to generate PDF invoices dynamically that could then be merged with the customers original PDF for the printer. While this was in 2003, I spent a retarded amount of time trying all sorts of pdf code tools like iText, jPDFWriter and PDFlib and the result always looked like dog shit. I could never get the type of design you were looking for, and there was always some stupid bug that stopped me from being 100% happy. Fast forward to 2011 and now we have DocRaptor.

This incredibly easy to use service takes HTML and converts it in to a PDF,  you can even include CSS and Javascript and the whole thing gets rendered (javascript rendering is still in beta). Hell, CSS border-radius even works, how frigging cool is that?

DocRaptor’s price ranges from $0.12 to $0.03 per PDF depending on which package you go with

Ideas

Now for the fun part! What ideas and business models can we manifest using this killer tool? Here are just a few that come to mind.

Blog to eBook Builder

Imagine a web app that takes a web blog, a photo and a title, then creates a super high quality eBook? You could imagine an interface that would use your blogs API to list out of your posts so you can individually select or filter on specific tags/categories and produce. Sure there are a few services out there right now, but most of them produce ugly as hell PDFs. After you build your service find a commercial printing partner.

Twitter Life Book

How about a web app that takes a users Twitter stream and produces a nice tiny book of all (or a filtered list) of your Tweets? Add a nice cover image, select a cool background color and boom – you’re in business.

Snazzy Invoice Generator Webservice

Using DocRaptor you could easily generate a sweet Invoice Generator  that could be sold to other 3rd party developers.

What other ideas do you have?

The Code

Using the DocRaptor API is incredibly straight forward. Best of all they offer examples in C#, Curl, jQuery, PHP, Prototype.js and Ruby.

Here’s a super simple PHP example that generates a PDF that contains the latest Tweets of a given Twitter user – download the final PDF here.

<?
	/************************************************************************
	Generate a PDF of a Twitter Users Last Tweets
	************************************************************************/

	$user = "brandoncorbin";
	$feed = "http://twitter.com/statuses/user_timeline/".$user.".xml";
	$api_key = "[YOUR-API-KEY-HERE]";
	$url = "https://docraptor.com/docs?user_credentials=$api_key";

	// Build the Document Content
	$document_content = "<div>";
	foreach($results->status as $status) {
		$document_content .= "<div class='status' style='padding:20px; text-align:center; margin:10px; background-color:#EEE;'>".$status->text."<div class='date'>".$status->created_at."</div></div>";
	}
	$document_content .= "</div>";

	// Lets call Request to DocRaptor
	$request = new HTTPRequest($url, HTTP_METH_POST);
	$request->setPostFields(array('doc[document_content]' => $document_content,
	                              'doc[document_type]'    => 'pdf',
	                              'doc[name]'             => 'twitter.pdf',
	                              'doc[test]'             => 'true',
	                              'doc[javascript]'		=> 'true'));
	$request->send();

	// Output the Results as a PDF
	header("Content-Type:application/pdf");
	echo $request->getResponseBody();

?>