hwrdprkns hwrdprkns - 1 year ago 323
iOS Question

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?

Answer Source

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!

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download