我正在使用 CGPDFDocument 将 pdf 绘制到 UIView 屏幕中。但是,我在绘制 pdf 时遇到了一些事情,所以您的帮助将不胜感激。
要求:我希望我的 pdf 文档以一定比例显示在 UIView 上,以便用户可以轻松阅读我的 pdf 文档,而无需放大或缩小。
正常流量:
//1. Set the frame of view
view.frame = CGRectMake(0,0,1008,612);
//2. Normal scale
CGContextScaleCTM(context, 1.0, -1.0);
//3. Translate PDF
CGContextTranslateCTM(context, 0, -[self bounds].size.height);
现在,当我尝试用因子 1.2 缩放 pdf 时,下面的值应该是多少:
//1. Set the frame of view
view.frame = CGRectMake(0,0,1008*1.2,612*1.2);
//2. here i am scaling the pdf with 1.2 scale factor
CGContextScaleCTM(context, 1.2, -1.2);
//3. Translate PDF, so what will be the value of below parameter according to scale factor 1.2?
CGContextTranslateCTM(context, ?, ?);
当我使用比例因子为 1.2 时,CGContextTranslateCTM 的值是多少?或者任何人都可以帮助我了解 CGContextTranslateCTM 函数的工作原理吗?