How can i add an image present in my Xcode project in to an HTML string to take a printout of that.
I have tried the following code but the image does’nt print instead a blank box appears in the PDF.
-(NSString *)prepareHTMLText {
NSMutableString *body = [NSMutableString stringWithString:@"<!DOCTYPE html><html><body>"];
[body appendString:@"<h2>Ingredients</h2>"];
[body appendFormat:@"<p>%@ %@</p>", @"text", @"TEStText"];
// [body appendFormat:@"<img src=\"%@\" alt=\"\" height=\"100\" width=\"100\"/>",[[NSBundle mainBundle] pathForResource:@"edit" ofType:@"png"]];
[body appendFormat:@"<img src=\"%@\"/>",[UIImage imageNamed:@"edit.png"]];
[body appendString:@"</body></html>"];
return body;
}
I am getting the out put as above

You need a URL, not a file path or the image object itself. Try something like: