Reputation: 4032
I have a HTML body as a NSString and would like to send it as an pdf-attachment. I'm quite new to iOS and can't figure out how, see code below.
NSString* body = "<html><body>stuff</body></html>"
MCOMessageBuilder * builder = [[MCOMessageBuilder alloc] init];
[builder setHTMLBody:body];
MCOAttachment *pdf = ... //body to pdf
[builder addAttachment:pdf];
Upvotes: 0
Views: 378
Reputation: 1742
Try this github iOS-htmltopdf. Its working for me. This code create one pdf file. store that file into document directory, and attach the pdf file in mail.
Upvotes: 2