dart_pdf icon indicating copy to clipboard operation
dart_pdf copied to clipboard

Printer settings for desktop

Open cuishijie1991 opened this issue 3 years ago • 4 comments

Is there a way to show Printer settings panel for desktop app? My application is a desktop application.. I use print.directprintpdf () for printing, but I need a feature called "Printer Settings" that displays the printer Settings without printing Is there a way to implement it? Thank you for any reply

cuishijie1991 avatar Nov 22 '21 06:11 cuishijie1991

Yes this can be implemented for all 3 desktop OS.

DavBfr avatar Nov 22 '21 10:11 DavBfr

Yes this can be implemented for all 3 desktop OS.

That is great! I known it is ok for windows, but on macOS, I don't know how to do it. I followed your plugin's implementation, but it is not what I want . There seems to be no way to convert the print button to Confirm. 截屏2021-11-24 上午10 30 16

code:

public func showPrinterSettings(printer: String, withWindow window: NSWindow) -> Void {
        let sharedInfo = NSPrintInfo.shared
        let sharedDict = sharedInfo.dictionary()
        let printInfoDict = NSMutableDictionary(dictionary: sharedDict)
        let printInfo = NSPrintInfo(dictionary: printInfoDict as! [NSPrintInfo.AttributeKey: Any])
        // Print the custom view
        printOperation = NSPrintOperation(view: self, printInfo: printInfo)
        printOperation!.jobTitle = "@@@@@@TEST"
        printOperation!.printPanel.options = [.showsPreview]
        printInfo.printer = NSPrinter(name: printer)!
        printOperation!.showsPrintPanel = true
        printOperation!.showsProgressPanel = false
        
        printOperation!.printPanel.options = [.showsPreview, .showsPaperSize, .showsOrientation]
        printOperation!.runModal(for: window, delegate: self, didRun:#selector(printOperationDidRun(printOperation:success:contextInfo:)), contextInfo: nil)
    }

cuishijie1991 avatar Nov 24 '21 02:11 cuishijie1991

The Linux printing system is very similar to macOS, so it might not be possible too.

DavBfr avatar Nov 26 '21 12:11 DavBfr

any solution @cuishijie1991 @DavBfr

Shams-Mahmoud avatar Jun 22 '22 12:06 Shams-Mahmoud

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days

github-actions[bot] avatar Apr 15 '23 00:04 github-actions[bot]

Closing this stale issue because it has no activity.

github-actions[bot] avatar Apr 21 '23 00:04 github-actions[bot]