Rendering a UIView into a PDF as vectors on an iPad - Sometimes renders as bitmap, sometimes as vectors

前端 未结 5 1979
眼角桃花
眼角桃花 2020-12-13 14:41

I have an iPad app and I\'m trying to generate a PDF from a UIView and it\'s almost working perfectly.

The code is really simple as follows:



        
5条回答
  •  甜味超标
    2020-12-13 15:09

    Trying using the view's viewPrintFormatter.

    Instead of [view.layer renderInContext:pdfContext];

    try this

    CALayer* formattedLayer = [view viewPrintFormatter].view.layer;
    [formattedLayer renderInContext:pdfContext];
    

提交回复
热议问题