Closed ChaosSaber closed 8 years ago
Ok i narrowed the problem down. UIGraphicsBeginPDFContextToFile()
returns a boolean if successful or not. The problem is: it's unfortunately not successful.
Tried to output it as data and then writing the data to a file. The Data could be created, but as soon as i want to write the data do a file i get an error: "Operation not permitted".
Well time to find out why i'm not permitted to do it.
Problem completely solved.
let dst = NSHomeDirectory().stringByAppendingString("/sample1.pdf")
is in iOS the path to the app bundle, which can not be changed during runtime.
i just need another save directory.
i advice you add an disclaimer/ warning in your readme at these parts.
Hello it's me again,
recently began working again on my little project. Until now i only used the simulator and it worked fine. But now that i tested my project on an iPad, i get the InvalidContext Error. In the Apple Documentation (https://developer.apple.com/reference/uikit/1623918-uigraphicsgetcurrentcontext) is stated, that you have to push a context on the stack if not called from an UIView, which is my case. But this should be done with this line of Code
UIGraphicsBeginPDFContextToFile(outputPath, .zero, password.toDocumentInfo())
which is called beforeSo i'm a bit clueless at the moment what could be wrong and cause this error. I Hope you can help me with that and thanks in Advance