'Check PDF Content Size and show alert Swift
Is there any way to find the current pdf content size.
For example:-
When user open the pdf file and fill some information in the pdf and click on submit button. Then how to check pdf content size means the content fill fully or not. If user not fully added the details, pending some TextFiled in the pdf, then we need to show alert "Please fill all the information."
Code:-
override func viewDidLoad() {
super.viewDidLoad()
if let documentURL = Bundle.main.url(forResource: pdfName, withExtension: "pdf") {
if let document = PDFDocument(url: documentURL) {
pdfView.autoScales = true
pdfView.backgroundColor = UIColor.lightGray
document.delegate = self
pdfView.document = document
pdfView.autoScales = true
}
}
}
Can someone please explain to me is it possible in swift if yes please guide me how to achieve this, I've tried lot of search but no results yet.
Any help would be greatly appreciated.
Thanks in advance.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
