如何在iPhone/iPad的UIWebView中调整PDF高度 [英] How to fit PDF height in UIWebView in iPhone/iPad

查看:106
本文介绍了如何在iPhone/iPad的UIWebView中调整PDF高度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用UIWebView来显示单页PDF文件的项目.我希望此内容适合高度(垂直).默认设置为仅适合宽度(水平).有什么办法可以克服这个问题?

I have a project that uses a UIWebView to display a single page PDF file. I would like this content to fit by height (vertically). The default is only to fit width (horizontally). Is there any way to overcome this?

推荐答案

我遇到了同样的问题,找不到使用UIWebView的方法.如果您只想显示一个PDF页面,则可以从中获取代码.苹果的ZoomingPDFViewer示例.

I ran against the same problem and couldn't find a way to do it with UIWebView. If you only want to display a single PDF-page, you can pretty much take the code from Apple's ZoomingPDFViewer Example.

我选了两个类PDFScrollView和TiledPDFView,并且对我的项目进行了一些调整,因此我很容易使用它来显示单个PDF页面.

I took the two classes PDFScrollView and TiledPDFView and with a little adjustment for my project, I was easily able to use it to display a single PDF page.

这篇关于如何在iPhone/iPad的UIWebView中调整PDF高度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆