如何解决从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 举报,一经查实,本站将立刻删除。