Sublime Forum

Printing from sublime

#203

I do not know if errors, but this is all I see:

reloading plugin Diff.diff
reloading plugin HTML.encode_html_entities
reloading plugin HTML.html_completions
reloading plugin ShellScript.ShellScript
plugins loaded

0 Likes

#204

It creates temp files in %TEMP% I now see but does not open the browser, which I have set to Firefox using the Default Apps settings.

This is on Windows 11 Insider Preview. Perhaps we cannot expect it to work.

0 Likes

#205

You could try setting the settings "print_using_browser" to firefox, but it should be using the default browser. Note we use the python webbrowser module to open a new tab.

0 Likes

#206

@bschaaf Here is what I get:

Traceback (most recent call last):
  File "C:\Program Files\Sublime Text\Lib\python38\sublime_plugin.py", line 1703, in run_
    return self.run(edit)
  File "C:\Program Files\Sublime Text\Packages\Default.sublime-package\html_print.py", line 19, in run
  File "./python3.8/webbrowser.py", line 65, in get
webbrowser.Error: could not locate runnable browser

using:

"print_using_browser": "firefox"

0 Likes

#207

MS does its best to force users to Edge browser. Maybe that’s involved in default browser not being found.

I have MSEdgeRedirect installed to force Win to use Firefox. Maybe this makes a difference.

You could try to add Firefox folder to %PATH% environment variable. Maybe python’s webbrowser module is able to locate and run it then.

0 Likes

#208

Success at last. Combining ideas from all the posts, and reading up on the python webbrowser module, I added this to the preferences settings file:

"print_using_browser": "firefox"

Then I added the path for firefox to the Windows PATH variable:

C:Program Files\Mozilla Firefox

A reboot, and printing now works. I hope this may be useful to people in the future.

1 Like

Print and open browser problem
#209

Thanks! Great!

0 Likes

#210

DEFINITELY, I reckon it would be really useful for printing to open the printing preview to print to .pdf

0 Likes