HTML to PDF using a WCF Service

Language: C#

This is a WCF service that exposes the WKHTMLtoPDF project which can be found at:

It can be used to generate a PDF given a URL, this PDF can be returned by the WCF service or the location of the generated PDF can be.  I wrote this to work with 0.9.9 of wkhtmltopdf (seems to be the least buggy).  However I believe it works with all versions.

There's a few gotchas for using this:

1. Make sure that you have the correct installation path for wkhtmltopdf.exe set in your config.
2. Ensure that Read and Execute rights are granted to the wkhtmltopdf folder for the relevant process
3. Ensure that Write rights are granted for the location you want to create your PDFs for the relevant process

The Demo.aspx file included is a test harness which demonstrates how the web service can be used.  Either to stream a PDF directly back to the client or to return a PDF URL which can be redirected to. This second method can be called via AJAX.

Project Statistics

Sourcerank 3
Repository Size 135 KB
Stars 6
Forks 1
Watchers 4
Open issues 0
Dependencies 0
Contributors 1
Tags 0
Last updated
Last pushed

Top Contributors See all

John Reilly

Something wrong with this page? Make a suggestion

Login to resync this repository