This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 122221
Collapse All | Expand All

(-)PDFOpenSupport.java (+20 lines)
Lines 79-85 Link Here
79
        final String filePath = f.getAbsolutePath();
79
        final String filePath = f.getAbsolutePath();
80
80
81
        if (Utilities.isWindows()) {
81
        if (Utilities.isWindows()) {
82
            /*
83
             * To run the PDF viewer, we need to execute:
84
             * 
85
             *      cmd.exe /C start <file name>
86
             * 
87
             * This works well except for cases that there is a space
88
             * in the file's path. In this case, the file's path must be
89
             * enclosed to quotes to make the command-line interpreter (cmd.exe)
90
             * consider it a single argument. BUT: If the first argument
91
             * to the "start" command is enclosed in quotes, it is considered
92
             * to be a window title. So, to make sure the file path argument
93
             * is not considered a window title, we must pass some dummy
94
             * argument enclosed in quotes as the first argument and the
95
             * actual file path as the second argument (of the 'start' command):
96
             * 
97
             *      cmd.exe /C start "PDF Viewer" <file name>
98
             * 
99
             * (see also bug #122221)
100
             */
82
            tryCommand(new String[] {"cmd.exe", "/C", "start",          //NOI18N
101
            tryCommand(new String[] {"cmd.exe", "/C", "start",          //NOI18N
102
                                     "\"PDF Viewer\"",  //win.title     //NOI18N
83
                                     filePath});
103
                                     filePath});
84
            return;
104
            return;
85
        }
105
        }

Return to bug 122221