iOS Library For Easy PDF Creation From An HTML String Or URL

I’ve mentioned a few resources showing how to created PDFs using UIKit and Quartz.

Here’s another nice library for creating PDF files from Brent Nycum called BNHtmlPdfKit.

With BNHtmlPdfKit you can easily create a PDF file by supplying an HTML string or you can supply a URL and BNHtmlPdfKit will create the PDF.

It is also possible to specify different page sizes, and margin sizes.

Here’s an example from the readme showing how easy it is to create a PDF from a URL using BNHtmlPdfKit:

@interface MyCoolViewController () {
BNHtmlPdfKit *_htmlPdfKit;
}

(void) createPdf:(id)sender {
_htmlPdfKit = [[BNHtmlPdfKit alloc] init];
_htmlPdfKit.delegate = self;
[_htmlPdfKit saveUrlAsPdf:[NSURL URLWithString:@"http://itsbrent.net/index.html"]];
}

@end

You can find BNHtmlKit on Github here.

A nice PDF creation library.

FacebookTwitterDiggStumbleUponGoogle Plus

Original article: iOS Library For Easy PDF Creation From An HTML String Or URL

©2013 iOS App Dev Libraries, Controls, Tutorials, Examples and Tools. All Rights Reserved.

Leave a Reply

Your email address will not be published. Required fields are marked *