CGContextDrawPDFPage taking up large amounts of memory

后端 未结 2 724
Happy的楠姐
Happy的楠姐 2020-12-01 08:52

I have a PDF file that I want to draw in outline form. I want to draw the first several pages on the document each in their own UIImage to use on a button so that when clic

2条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-01 09:05

    Take a look at my code for a PDF image slicer on github:

    http://github.com/luciuskwok/Maps-Slicer

    There should be enough memory on the device that a 13 MB allocation isn't going to kill the app. Are you draining the autorelease pool each time you render a PDF? You might also want to cache the rendering into a UIImage so that it doesn't have to render it every time it's displayed.

提交回复
热议问题