打开pdf文件时,TwebBrowser Zoom / Gesture在XE4中的firemonkey / iO中不起作用 [英] TwebBrowser Zoom/Gesture is not working for firemonkey/iOs in XE4 when open a pdf file
问题描述
我想在iOS应用程序中显示PDF,到目前为止,我唯一找到的方法是在TwebBrowser中打开它。
I want to display PDF within iOS application, so far the only way I find is open it in TwebBrowser.
A。它显示在适合页面中宽度默认为缩放
A.It is displaying in "fit to page width" zoom as default
B。没有缩放功能
WebBrowser1.Navigate(文件: //mypdf.pdf')
WebBrowser1.Navigate(file://mypdf.pdf')
如何
- 我要更改打开文件后进行缩放(我的解决方案遇到q#2)
- 进行缩放工作(我的解决方案遇到q#3)
- 进行缩放像网页一样工作的手势
对于#1:
I chagne WebBrowser1.height / width在运行时,它将自动缩放(缩放?)为适合宽度。
I chagne WebBrowser1.height/width in run-time, it will auto scale(zoom?) as "Fit to width".
可以,垂直滚动条也可以有缺陷-它不会在边缘反弹->您可以一直向下滚动。
Yes it works, and vertical scroll bar works with a flaw - it will not bounce back on edge -> you can scroll all the way down..
水平滚动都没有,也没有任何反应...。
Neither the horizontal scroll, not reacting at all....
*这是因为pdf为A4,所以不确定横向样式会发生什么情况
*This is because the pdf is A4, not sure what will happen for a landscape style
对于#2:
除了点击按钮进行缩放外,我还添加了一个handleManager。
Beside using button clicks to zoom, I add a gestureManager.
然后像 iOS Interactive Gestures-Image Zoom示例一样添加Form1.ongesture。
Then add Form1.ongesture just like the "iOS Interactive Gestures - Image Zoom" example.
是的,但是同样的事情-没有垂直弹跳,无水平滚动。
Yes it works, but same thing - no vertical bounce, no horizontal scroll.
* ScrollBox不起作用,不适用于具有内置vert / hori滚动条的任何东西
*ScrollBox does not work, it will not work with any thing has a build-in vert/hori scroll bars
对于#3
:
我走得更远,为上/下/左/右写控制
For #3 : I go even further, write control for up/down/left/right
更改WebBrowser1.Position.X / Y和WebBrowser1.height / width使其看起来像滚动
Change WebBrowser1.Position.X/Y and WebBrowser1.height/width to make it looks like "scrolling"
可以,但是两个自定义手势控件
Yes it works... but two custom gesture controls are making it really hard to control
(EventInfo.Distance和EventInfo.X / Y,如果您在iPhone上运行,那两个控件有点重叠)
(EventInfo.Distance and EventInfo.X/Y, those 2 controls are kinda overlaping to eachother if you run in iPhone)
wosrt部分是,无论父子结构如何,WebBrowser1都将位于任何补偿之上。
第二个最糟糕的部分是保证金的限制很难编码,因此总是可以超出限制.....
The wosrt part is, the WebBrowser1 will be on top of ANY compenment, regardless parent/child structure . The second worst part is the limitation of margin is hard to code, somehow it can always scroll over the limit.....
我感觉到(如果要更改打开/打开后的缩放比例),并在同时显示两个vert / hori scrool条的情况下将其打开。
然后水平条应该起作用->我只需要处理缩放->非常接近完美。
I "feel" if changing the zoom on/after open, and make it open with both vert/hori scrool bars visible. Then the horizontal bar should work -> i only need to deal with zoom -> pretty close to prefect.
当然,最好的方法是使其就像网页一样工作,例如
WebBrowser1.Navigate(' http://www.embarcadero.com/')->两个滚动条都可以工作,缩放工作。
,但是...可能需要此服务包N吗?
Of course the best way is to make it work like a web page, like WebBrowser1.Navigate('http://www.embarcadero.com/') -> both scrollbars works, zoom work. but...maybe need service pack N for this?
感谢您提供任何想法或代码答案。
I appreciate for any ideas or code answers.
这只该死的猴子着火了,总是很难从中找到答案。
This damned monkey is on fire and its always hard to find an answer from it.
推荐答案
错误,并已在XE4更新中修复。
It was a bug, and fixed in the XE4 update.
这篇关于打开pdf文件时,TwebBrowser Zoom / Gesture在XE4中的firemonkey / iO中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!