Get Updates By E-mail 

Article Written By:
Johann Dowa

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.


  •  
  •  
  •  
  •  
  •  

Submit A Resource

Have you created a useful tutorial, library or tool for iOS development that you would like to get in front of our 300,000+ monthly page views from iOS developers?

You can submit the url here.

The resources we feel will appeal to our readers the most will be posted on the front page.

Comments