skip to Main Content

Does anyone know of a extensions / PDF viewer in VSCode such that it easily inverts or changes the color of the background (preferably only the background).
I know of the LaTeX Workshop setting but that for me is always quite a hustle to toggle.
I just want a simple toggling between my standard- and darkmode (which is not directly linked with a theme I use)

2

Answers


  1. This from tomoki1207 is a simple PDF viewer for VSCODE and it has a settings to invert colors.

    enable invert mode from you settings.json file and add:

    "pdf-viewer.invert":true

    and for your LaTeX Workshop you can add custom CSS to invert the PDF viewer colors in settings.json like below

    "latex-workshop.viewer.pdf.darkmode.invert":true

    or if you want to use keyboard shortcut you can use from File > Preferences > Keyboard Shortcuts
    your available shortcut keys for ex: Ctrl+Shift+P

    and custom command in JSON as below:

    {
      "key": "ctrl+alt+d",
      "command": "workbench.action.toggleSetting",
      "args": {
        "setting": "pdf-viewer.invert"
      }
    }
    

    hope this helps.

    Login or Signup to reply.
    1. PDF Viewer Extension:

      • Install the "vscode-pdf" extension from the marketplace. This extension has a built-in PDF viewer and matches your VSCode theme, so if you’re using a dark theme in VSCode, the extension will display the interface elements (like toolbars) in dark mode, but it may not change the actual content of the PDF itself.
    2. Dark Reader Extension (for full dark mode):

      • For PDFs with light backgrounds, try installing the "Dark Reader" extension for VSCode. It forces a dark theme across everything in VSCode, including webview content. Sometimes, this can darken the background of PDFs too, but it may not be perfect with all files.
    3. Alternative PDF Viewers:

      • If neither option fully meets your needs, another option is using an external PDF viewer that supports dark mode, like Adobe Acrobat Reader or SumatraPDF with dark mode. They usually have advanced viewing features and make it easy to switch between light and dark backgrounds.
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search