从PDFKit iOS框架旋转页面,而PDFAnnotation中没有任何更改

问题描述

我有一个pdf应用程序 我想旋转pdf这是我的代码 但是我希望教科书注释不更改并保持在纵向模式下,该怎么办,因为每次旋转页面并开始添加教科书时,我的文本框都将以旋转模式添加!

这是我用于创建文本框的代码:

let linkAnn = PDFAnnotation.init(bounds: CGRect(x: 150,y: 350,width: 180,height: self.usingHeightText),forType: PDFAnnotationSubtype.widget,withProperties: nil)
linkAnn.widgetFieldType = .text
linkAnn.isMultiline = true
linkAnn.contents = "fileNumber\(self.pdfClickedRow)PageNumber\(getPagenumber)addtext\(self.AddTextCount)"   //"\(AddTextCount)"
linkAnn.widgetStringValue = NSLocalizedString("placeholder",comment: "")
linkAnn.font = UIFont(name: self.usingFontName,size: CGFloat(self.usingFontSize))
linkAnn.fontColor = self.usingFontColor
linkAnn.backgroundColor = self.usingBGFontColor.withAlphaComponent(self.usingBGFontAlpha)
        linkAnn.setValue("addtext\(self.AddTextCount)",forAnnotationKey: PDFAnnotationKey.name)
let index = self.pdfDocument?.index(for: self.pdfView.currentPage!)
self.pdfView.document?.page(at: index!)?.addAnnotation(linkAnn)

这是我的代码rotate:

 self.pdfView.currentPage?.rotation += 90
 self.pdfView.annotationsChanged(on: pdfView.currentPage!)

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...