I am looking for a way to programmatically (in obj-c) generate a PDF file from a local html file. I am dynamically generating the html from user inputs, I need to create the PD
I've written a little piece of code that takes an NSAttributedString
from DTCoreText
, and renders it into a paged PDF file. You can find it on my GitHub Repository. It won't render images or complex html, but it should serve for most uses. Plus, if you're familiar with CoreText
, you can extend my PDF frame setter to generate these items.
So what it does now: Give it an HTML string, and it will use DTCoreText
to generate an NSAttributedString
, then render that into a PDF. It hands back the location that it saved the PDF file in the app's Documents folder.