Post

Replies

Boosts

Views

Activity

PDF - Rendering Issue in iOS 15.0
Hi, I have some problems with rendering pdf pages in iOS 15.0. On iOS 14 and before iOS versions it’s working perfectly. But in iOS 15 and after releasing new versions I have faced the same issue. I have a PKCanvas View. Actually what I have to achieve is to convert that PKCanvas view into PDF. First I have written some words in the PKCanvas view using PencilKit and converted that PKCanvas view into an image and then I have converted that image into PDF. After that, I have loaded that PDF in WKWebview. There is no problem yet. But when I try to convert that WKWebview to again convert into PDF Using the rendering option there are mirror words are automatically occurring which error I have faced while creating the PDF from WKWebview by rendering option. let render = UIPrintPageRenderer()           render.addPrintFormatter(self.previewWebView.viewPrintFormatter(), startingAtPageAt: 0)         // 3. Assign paperRect and printableRect           let page = CGRect(x: 0, y: 0, width: 595.2, height: 841.8) // A4, 72 dpilet printable:CGRect = CGRect(x: 0, y: 0, width: 595.2, height: 841.8)        render.setValue(NSValue(cgRect: page), forKey: “paperRect”)         render.setValue(NSValue(cgRect: printable), forKey: “printableRect”)         // 4. Create PDF context and draw         let pdfData = NSMutableData()         UIGraphicsBeginPDFContextToData(pdfData, CGRect(x:0,y:0,width: 595.2,height:841), nil)        for i in 1...render.numberOfPages {             UIGraphicsBeginPDFPage();             let bounds = UIGraphicsGetPDFContextBounds()             render.drawPage(at: i-1, in: bounds)         }         UIGraphicsEndPDFContext(); How to resolve this issue? Please help us ASAP. Thanks in advance. For your reference, I have attached the PDF Page screenshot!
0
0
976
Jan ’22
PDF Broken issue iOS 15.0
H i, I have used the PKCanvas view in my app. writing something in my PKCanvas View then convert it into a PDF. But adding the header for each page in PDF by using the following code,   let printable:CGRect = CGRect(x: 0, y: 50, width: 595 , height: 841)       render.setValue(NSValue(cgRect: page), forKey: "paperRect")       render.setValue(NSValue(cgRect: printable), forKey: "printableRect")       // 4. Create PDF context and draw       let pdfData = NSMutableData()       UIGraphicsBeginPDFContextToData(pdfData, CGRect(x:0,y:0,width: 595.2,height:841), nil)       for i in 1...render.numberOfPages {           UIGraphicsBeginPDFPage();           let bounds = UIGraphicsGetPDFContextBounds()           render.drawPage(at: i-1, in: bounds)       }       UIGraphicsEndPDFContext(); But while renderer the PKCanvas View it was broken, I think PKCanvas view rendering is not properly working in iOS 15.0,15.0.1 and 15.0.2. I have attached the following screenshot,
2
0
877
Oct ’21