Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/domain7/html-to-paginated-pdf

HTML to Paginated PDF
https://github.com/domain7/html-to-paginated-pdf

Last synced: 1 day ago
JSON representation

HTML to Paginated PDF

Awesome Lists containing this project

README

        

Use case: You need to create a PDF.

Possible Solutions:
1. Do not create a PDF.
2. You still need to create a PDF :( so use HTML and CSS because all content should be HTML.

Controlling a document's page breaks, font rendering and margins is possible using the media type of print with CSS. However, browser's rendering engines do not follow these rules consistently by any means. The result is that printing a web page to PDF from a browser is most often pointless because of the quality of rendering.

In order to take advantage of print CSS declarations this program will take your web page via a URL. It will then respect the print CSS of the page and render it using one rendering engine (WebKit) on one platform (OS X) and return the rendered content as a PDF. This way you can print an HTML page to PDF from any web browser or server-side program.

Requirements:

* OS X
* ruby
* Sinatra gem
* wkpdf gem
* Ruby cocoa
* Connection to the Internets