简体   繁体   English

Objective-C PDF渲染

[英]Objective-c PDF rendering

How can i reduce the size of PDF being rendered using [v.layer renderInContext:pdfContext]; 我如何使用[v.layer renderInContext:pdfContext];要呈现的PDF的大小[v.layer renderInContext:pdfContext]; Right now, I am rendering a 10 pages PDF with 20 images(2 of each page) and the size is 2.7mb. 现在,我正在渲染一个10页的PDF,其中包含20张图像(每页2张),大小为2.7mb。 How can I reduce it to less than 2 mb? 如何将其减小到2 mb以下?

Thanks! 谢谢!

from RR's comment, you can try to reduce a little quality of each image before doing the conversion to PDF. 从RR的评论中,您可以尝试在转换为PDF之前降低每个图像的质量。 Like this: 像这样:

lowResImage = [UIImage imageWithData:UIImageJPEGRepresentation(highResImage, quality)]; lowResImage = [UIImage imageWithData:UIImageJPEGRepresentation(highResImage,quality)];

Make quality < 1.0 etc. 使质量<1.0等

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

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