【发布时间】:2013-11-19 06:49:08
【问题描述】:
我正在尝试将签名集成到 pdf 文件中,该文件显示在 UIWebview 中。我可以通过固定位置说(50,50)将签名集成到pdf文件中。现在尝试将其集成到用户的单击位置。首先尝试通过代码获取用户的点击位置,
CGPoint tapLocation = [gesture locationInView: self.view];
NSLog(@"tapped location is %@ \n",NSStringFromCGPoint(tapLocation));
NSInteger x,y;
x=tapLocation.x;
y=tapLocation.y;
CGRect imageRect = CGRectMake(x,y, image.size.width, image.size.height);
我可以获取坐标,但签名没有放在我点击 pdf 文件的位置,然后发现,坐标返回的位置不正确。例如,如果我在位置(50,50)点击它的返回(68,386),那么签名将集成在位置(68,386)。
谁能帮我解决这个问题?
【问题讨论】:
-
尝试使用 CGPoint tapLocation = [gesture locationInView: self.yourWebview];
-
@PradhyumanChavda,你试过 [gesture locationInView: webview];但结果是一样的。
标签: ios objective-c pdf uiwebview integration