|
@@ -258,9 +258,11 @@ extension KMPrintWindowController {
|
|
|
|
|
|
static func showPrintWindowControll(inputData: URL?, inputDocument: AnyObject?, inputType: DataNavigationViewButtonActionType = .Print, inputPageRange: KMPrintPageRange) {
|
|
|
var document: PDFDocument?
|
|
|
- let filePath = KMPrintPresenter.fetchSaveFilePath("")
|
|
|
+ var filePath = ""
|
|
|
+
|
|
|
var password: String = ""
|
|
|
if inputDocument != nil {
|
|
|
+ filePath = KMPrintPresenter.fetchSaveFilePath(fileName: inputDocument?.documentURL?.path.lastPathComponent ?? "text.pdf")
|
|
|
// if inputDocument != nil {
|
|
|
if inputDocument is CPDFDocument {
|
|
|
let success = inputDocument?.writeDecrypt(to: URL(fileURLWithPath: filePath))
|
|
@@ -274,6 +276,7 @@ extension KMPrintWindowController {
|
|
|
}
|
|
|
|
|
|
if inputData != nil {
|
|
|
+ filePath = KMPrintPresenter.fetchSaveFilePath(fileName: inputData?.path.lastPathComponent ?? "text.pdf")
|
|
|
document = PDFDocument.init(url: inputData!)!
|
|
|
}
|
|
|
|
|
@@ -284,7 +287,7 @@ extension KMPrintWindowController {
|
|
|
inputPageRange.selectPages.count != 0) {
|
|
|
|
|
|
let printPresent = KMPrintPresenter()
|
|
|
- let filePath = KMPrintPresenter.fetchSaveFilePath("")
|
|
|
+// let filePath = KMPrintPresenter.fetchSaveFilePath("")
|
|
|
let paperSize = (document?.page(at: 0)?.bounds(for: .cropBox).size) ?? CGSizeZero
|
|
|
let context: CGContext = printPresent.createContext(filePath, paperSize)
|
|
|
var pages: [PDFPage] = []
|