objective-cioscocoa-touchairprint

How to Add Images in UIMarkupTextPrintFormatter?


I'm trying to print a file using straight HTML, however, I am having difficulties adding images to the print file.

How can I reference images in my project in the HTML that I want to print? Does the UIMarkupTextPrintFormatter support tags?


Solution

  • It's actually much simpler than I thought:

    NSString *yourImagePath = [[[NSBundle mainBundle] URLForResource:@"resource" withExtension:@"extension"] absoluteString];
    

    Then you can put the image path in an <img> and it will render the image! Voila!