View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0017519 | Scribus | Printing | public | 2025-05-13 15:12 | 2025-05-13 21:03 |
Reporter | jirib | Assigned To | |||
Priority | normal | Severity | minor | Reproducibility | always |
Status | new | Resolution | open | ||
Product Version | 1.6.5.svn | ||||
Summary | 0017519: Flaws with 'Alternative Printer Command' and 'File' output filename | ||||
Description | There are flaws in Setup Print dialog, wrong handling of File and Alternative Printer Command | ||||
Steps To Reproduce | scenario I. ========= 1. ctrl-p to open 'Setup Printer' 2. select File destination (destination!) 3. see that 'File' output filename is defined, that is, non-empty (the file should not exist now!) 4. enable 'Alternative Printer Command' 5. see that 'File' output filename text box was grayed out (ineffective) 6. set 'Command' to /bin/true 7. Print button Result: /tmp/foo.pdf is present; /bin/true was never executed (observed via strace) scenario II. ========== 1. ctrl-p to open 'Setup Printer' 2. select File destination (destination!) 3. make 'File' output filename text box empty (no value) 4. enable 'Alternative Printer Command' 5. see that 'File' output filename text box was grayed out (ineffective) 6. set 'Command' to /bin/true 7. Print button Result: 'Printing failed!' | ||||
Additional Information | I tried to cook a diff, not sure if valid, sorry, not compiled and tested: ---%>--- diff --git a/scribus/plugins/scripter/api_printer.cpp b/scribus/plugins/scripter/api_printer.cpp index 1de480c6f..fb5d05f80 100644 --- a/scribus/plugins/scripter/api_printer.cpp +++ b/scribus/plugins/scripter/api_printer.cpp @@ -74,11 +74,9 @@ void PrinterAPI::doPrint() QString printcomm; bool fil, PSfile; PSfile = false; - // ReOrderText(ScCore->primaryMainWindow()->doc, ScCore->primaryMainWindow()->view); prn = printer; fna = file; - fil = (printer == QString("File")) ? true : false; std::vector<int> pageNs; PrintOptions options; for (int i = 0; i < pages.size(); ++i) { @@ -88,7 +86,6 @@ void PrinterAPI::doPrint() SepName = separation; options.printer = prn; options.prnEngine = (PrintEngine) pslevel; - options.toFile = fil; options.separationName = SepName; options.outputSeparations = (SepName == QString("No")) ? false : true; options.useColor = color; @@ -108,6 +105,8 @@ void PrinterAPI::doPrint() if (!PrinterUtil::checkPrintEngineSupport(options.printer, options.prnEngine, options.toFile)) options.prnEngine = PrinterUtil::getDefaultPrintEngine(options.printer, options.toFile); printcomm = cmd; + fil = (printer == QString("File")) && printcomm.trimmed().isEmpty(); + options.toFile = fil; QMap<QString, QMap<uint, FPointArray> > ReallyUsed; ReallyUsed.clear(); ScCore->primaryMainWindow()->doc->getUsedFonts(ReallyUsed); @@ -159,7 +158,7 @@ void PrinterAPI::doPrint() if (!fil) { - if (!printcomm.isEmpty()) + if (!printcomm.trimmed().isEmpty()) cmd = printcomm + " "+fna; else { ---%<--- | ||||
Tags | No tags attached. | ||||
Patch | No | ||||
|
printer-dialog.diff (1,588 bytes)
diff --git a/scribus/plugins/scripter/api_printer.cpp b/scribus/plugins/scripter/api_printer.cpp index 1de480c6f..fb5d05f80 100644 --- a/scribus/plugins/scripter/api_printer.cpp +++ b/scribus/plugins/scripter/api_printer.cpp @@ -74,11 +74,9 @@ void PrinterAPI::doPrint() QString printcomm; bool fil, PSfile; PSfile = false; - // ReOrderText(ScCore->primaryMainWindow()->doc, ScCore->primaryMainWindow()->view); prn = printer; fna = file; - fil = (printer == QString("File")) ? true : false; std::vector<int> pageNs; PrintOptions options; for (int i = 0; i < pages.size(); ++i) { @@ -88,7 +86,6 @@ void PrinterAPI::doPrint() SepName = separation; options.printer = prn; options.prnEngine = (PrintEngine) pslevel; - options.toFile = fil; options.separationName = SepName; options.outputSeparations = (SepName == QString("No")) ? false : true; options.useColor = color; @@ -108,6 +105,8 @@ void PrinterAPI::doPrint() if (!PrinterUtil::checkPrintEngineSupport(options.printer, options.prnEngine, options.toFile)) options.prnEngine = PrinterUtil::getDefaultPrintEngine(options.printer, options.toFile); printcomm = cmd; + fil = (printer == QString("File")) && printcomm.trimmed().isEmpty(); + options.toFile = fil; QMap<QString, QMap<uint, FPointArray> > ReallyUsed; ReallyUsed.clear(); ScCore->primaryMainWindow()->doc->getUsedFonts(ReallyUsed); @@ -159,7 +158,7 @@ void PrinterAPI::doPrint() if (!fil) { - if (!printcomm.isEmpty()) + if (!printcomm.trimmed().isEmpty()) cmd = printcomm + " "+fna; else { |
|
When the selected print destination is "File", the Alternative Print Command should be in fact disabled. Using an alternative print command has never been supported when printing to file. |