簡體   English   中英

從UIWebView提取jSignature圖像

[英]Extract jSignature image from UIWebView

我試圖從UIWebView提取簽名位圖。

這是HTML代碼:

<canvas class="jSignature" width="200" height="120" style="margin: 0px; padding: 0px; border: none; height: 120px; width: 200px;"></canvas>

此代碼在JS中有效:

$('.signature').jSignature('getData','image')

這是我的代碼:

NSString *sign = [self.webView stringByEvaluatingJavaScriptFromString:@"$('.signature').jSignature('getData','image')"];

所以sign是:

<object returned empty description>

有什么方法可以從stringByEvaluatingJavaScriptFromString獲取錯誤消息來調試此問題?

找到解決方案。 閱讀jSignature的文檔: http ://willowsystems.github.io/jSignature/#/about/

因此應該是:

NSString *sign = [self.webView stringByEvaluatingJavaScriptFromString:@"$('.signature').jSignature('getData')"];

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM