Invert colors?

Operating system

macOS

Joplin version

2.14.20

Desktop version info

Joplin 2.14.20 (prod, darwin)

Client ID: b1d8f69ee06443889acb19f7ffbeabb2
Sync Version: 3
Profile Version: 46
Keychain Supported: Yes

Revision: cfd98e3

Backup: 1.4.0

What issue do you have?

Is there a simple way to have a dark gray background with light colored text?

If you mean a dark theme go to Tools-Options-Appearance and pick something. There's a few dark themes there.

Although this makes the joplin window dark, the exported pdf is still light. How can I export a pdf with the appearrance of the document in joplin?

I think that would be a function of whatever you are using to read the PDF rather than what you use to create it. If you created it with a dark background you would use a lot of toner/ink if you ever wanted to print it!

I use a few different PDF readers on Windows (FoxIt, Edge) and some Android ePub readers and the Android readers can view a PDF in "dark" mode while the Windows ones can't.

I have tried typora and it can export a dark background pdf

Does it export a PDF or an image in a PDF wrapper? A PDF can be edited and searched.

it exports a real pdf. see attached

Quick Start.pdf (101 KB)

Cool! The version of Typora I have doesn't do this but it would make it easier to read for me. Hard on toner but I don't print that much these days. Was going to purchase a newer version but the payment process got blocked so I'm using the free one. This ability in Joplin might take quite a bit of work (or maybe not) so it's out of my league.

One possible workaround is to invert the colors of the note with CSS when printing. This can be done by:

  1. Adding the following CSS to the beginning of a note in the markdown editor:
    <style>
    	@media print {
    		/* Move the margin from the page to
    		   the root element. This allows the background
    		   color to fill the entire exported PDF page */
    		@page {
    			margin: 0;
    		}
    		:root {
    			padding: 0.5in;
    		}
    		/* Change the background color of the exported page.
    		   #222 is a dark gray. */
    		:root {
    			background-color: #222;
    		}
    		/* Invert all colors on the page. This will also change the colors
    		   of images. The hue-rotate(180deg) attempts to correct for this
    		   color change.*/
    		body {
    			filter: invert(1) hue-rotate(180deg);
    			background: transparent;
    		}
    	}
    </style>
    
  2. Exporting the note to PDF. I've only tested with the :exportPdf command from the command palette — I'm unsure if this will work if printing to file.

I dont print pdfs but do use them as email attachments. I use the export command and even though i have the colors set so the background is dark in joplin, the export does not reflect this . I will try using css in the markdown

It's almost there. Export as PDF results in (a screenshot) . . .

AlmostDark.bmp (1.8 MB)

Not perfectly readable as the single line of text is a very light grey on white and the contrast makes it difficult, but a lack of contrast seems to be the way most "dark modes" operate anyway. :slight_smile:

first off, the joplin site links to a download of an old version, 2Joplin-2.14.20-arm64
I had to go to the github to get v 3.06

second, I must be doing something wrong because although the joplin theme is dark,
i-imgur-com - fmAiOgL.png

the exported pdf is light -
i-imgur-com - 8x9OhBf.png

(the above are links - replace dashes with dots and slashes)

If Typora does what you need I suggest you use it. Simply set Typora to be your external editor (Options-General-Text editor command) and with one click you can have the note open in Typora and export it any way you like. I often find something Joplin can't do and simply use whatever will do what I want. I use Libre Office when I need formatting that is beyond markdown's limited abilities.

Joplin does a lot of things but doesn't (thankfully) do everything. Use what works.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.