|
@@ -648,6 +648,11 @@ extension KMHomeViewController {
|
|
|
func openBlankPage() {
|
|
|
let fileName: NSString = String(format: "%@.pdf", NSLocalizedString("Untitled", comment: "")) as NSString
|
|
|
let savePath = fetchUniquePath(fileName.kUrlToPDFFolderPath() as String)
|
|
|
+ let filePath = savePath.deletingLastPathComponent
|
|
|
+ if FileManager.default.fileExists(atPath: filePath) == false {
|
|
|
+ try?FileManager.default.createDirectory(atPath: filePath, withIntermediateDirectories: false)
|
|
|
+ }
|
|
|
+
|
|
|
let pdfDocument = CPDFDocument()
|
|
|
pdfDocument?.insertPage(CGSize(width: 595, height: 842), at: 0)
|
|
|
pdfDocument?.write(to: URL(fileURLWithPath: savePath))
|