开发者

How can I avoid using CATiledLayer when rendering a PDF?

开发者 https://www.devze.com 2023-01-30 05:25 出处:网络
I have been trying to render PDF documents into a CATiledLayer, but this appears to be slowing down the rendering process on the iPad.

I have been trying to render PDF documents into a CATiledLayer, but this appears to be slowing down the rendering process on the iPad.

I've also tried using a normal layer, but I've not seen an improvement.

Is there any alternative to using a CATiledLayer f开发者_运维知识库or rendering a PDF?


CATiledLayer is necessary either by itself or as a backing layer for a UIView when you are attempting to display a view or layer that exceeds the maximum texture size supported by the GPU. Apple lists this as 1024x1024 for the iPhone, but in my experience I've been able to go up to 2048x2048 on even the first-generation iPhone.

If you are able to render to a view or layer that is smaller in both width and height than those dimensions, you don't need to use a CATiledLayer and can get away with a standard layer. The tiling process does slow rendering a bit as it brings in the appropriate tiles, so you could gain some performance that way.

For a discussion on general PDF rendering performance, I direct you to this question:

Fast and Lean PDF Viewer for iPhone / iPad / iOs - tips and hints?

0

精彩评论

暂无评论...
验证码 换一张
取 消