Reduce pdf size - Objective c

南楼画角 提交于 2019-12-01 09:25:52

I struggled a lot.. at last when wrote image in jpeg format to pdf page using below code, size got reduced ten times!! Don't know it is the right method...

UIImage *lowResImage = [UIImage imageWithData:UIImageJPEGRepresentation(plotImage, 0.02)];

Instead of resizing the rect in the context, You need to change the CTM (Current Transform Matrix).

CGContextSaveGState(theContext);


CGContextScaleCTM(theContext, scaleFactor, scaleFactor);

... Drawing commands here ...

CGContextRestoreGState(theContext);

(http://macdevcenter.com/pub/a/mac/2004/11/02/quartz.html)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!