Cannot create PDF document with 400+ pages on iOS

前端 未结 4 1371
生来不讨喜
生来不讨喜 2020-12-06 05:37

I am using the following pseudocode to generate a PDF document:

CGContextRef context = CGPDFContextCreateWithURL(url, &rect, NULL);

for (int i = 1; i &l         


        
4条回答
  •  爱一瞬间的悲伤
    2020-12-06 05:51

    Probably not the answer you want to hear, but looking at it from another perspective.

    Could you consider it as a limitation of the device?... First check the number of pages in the PDF and if it is too large, give a warning to the user. Therefore handling it gracefully.

    You could then expand on this....

    You could construct small PDF's on the iDevice and if the PDF is too large, construct it server-side the next time the iDevice has a net connection.

提交回复
热议问题