如何在iPad中获得实际的PDF页面大小? [英] How to get actual pdf page size in iPad?

查看:307
本文介绍了如何在iPad中获得实际的PDF页面大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在iPad中获取PDF页面宽度和高度?关于如何找到这些信息的任何文件或建议?

How can I get PDF page width and height in iPad? Any document or suggestions on how I can find this information?

推荐答案

我在这里使用答案,直到我意识到一个单行为此

I was using the answers here until I realised a one-liner for this

CGRect pageRect = CGPDFPageGetBoxRect(pdf, kCGPDFMediaBox);
// Which you can convert to size as
CGSize size = pageRect.size;

用于Apple的样本ZoomingPDFViewer应用程序

Used in Apple's sample ZoomingPDFViewer app

这篇关于如何在iPad中获得实际的PDF页面大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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