I generate an image locally in a UIWebView and I would like to save this image in my main bundle after generation so I don’t have to perform this operation more than once. I use a jquery .js source and loadHtmlString command using the following string, with the jquery barcode generator scripts given included:
<html>
<head>
<SCRIPT LANGUAGE="JavaScript" SRC="jquery-1.3.2.min.js"></script>
<SCRIPT LANGUAGE="JavaScript" SRC="jquery-barcode-2.0.2.min.js"></script>
</head>
<body>
<div id="bcTarget1"></div>
<script>var a = $("#bcTarget1").barcode("Content", "code128", {barWidth: 1 , barHeight: 60, showHRI: false, "output":"bmp" });</script>
</body>
</html>
The image generates fine and I can show it in a webview, but because the file is generated locally, I am not able to generate a UIImage with a URL in the usual fashion. I am not very html, js, or jquery saavy; so I am at a loss for what to do here. Any help is greatly appreciated. Thanks!
You could use something like this to generate a UIImage from your UIWebView (where view is your UIWebView):
Then this to store the image in your bundle: