Hi,
I want to convert html to pdf dynamically in objective c. what is the best way to convert it, so that it maintains its look same as html. Thanks in advance.
Prasad.
Hi,
I want to convert html to pdf dynamically in objective c. what is the best way to convert it, so that it maintains its look same as html. Thanks in advance.
Prasad.
Objective-C is a programming language, it doesn’t know anything about HTML or PDF per se. How to do this depends on the framework you’re using. I’m assuming here you’re using Cocoa on OS X.
There you can load your HTML into a WebView
provided by WebKit and then use the NSView
method dataWithPDFInsideRect:
to render it as PDF. I haven’t tested this, but maybe you’ll have to add the web view to a window before you can query the PDF data.