简体   繁体   English

ios-根据设备方向加载pdf并跳转到页面

[英]ios - load pdf depending on device orientation and jumping to a page

Here is the situation - my client has a pdf document, in two versions, portrait and landscape layout. 情况就是这样-我的客户有一个pdf文档,有纵向和横向两种版本。 He wanted me to write an application which would load the pdf based on device orientation, and when the orientation changes, the other corresponding version would get displayed. 他要我编写一个应用程序,该应用程序将根据设备方向加载pdf,并且当方向更改时,将显示其他对应的版本。

Here is the use case 这是用例

  • start device in landscape mode - landscape.pdf is loaded 以横向模式启动设备-加载landscape.pdf

  • device changes orientation to portrait - portrait.pdf is loaded and shown 设备将方向更改为纵向-加载并显示portrait.pdf

  • device changes orientation to landscape - landscape.pdf is shown 设备将方向更改为横向-显示landscape.pdf

This is all easy to do, but the real culprit is the fact that pdf files have more than one page, and when device changes orientation while displaying some other page than first, it would need to jump directly to that page. 这一切都很容易做到,但真正的罪魁祸首是pdf文件具有多个页面,并且当设备在显示除第一页之外的其他页面的同时更改方向时,将需要直接跳转到该页面。

My question is whether this is possible in iOS? 我的问题是这在iOS中是否可行? Can I load a PDF and jump directly to a specific page? 我可以加载PDF并直接跳转到特定页面吗?

如果使用UIWebView加载PDF,并且有滚动视图,则可以指定位置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM