0

OS: Kubuntu 22.04.4 LTS x86_64
okular 21.12.3
konsole 21.12.3

to display above:
neofetch --stdout |grep 'OS:'
okular -version
konsole -version

outputs:

ok match color Blue        in Terminal with Blue      in okular  
no match color BrightWhite in Terminal with DullWhite in okular  
               BrightWhite in Terminal = tput setaf 7 in bash  

image1 desired colors, Terminal Output
image1,desired colors, Terminal Output:

.

image2 undesired colors
image2,undesired colors, PDF okular output, converts BrightWhite to DullWhite:

.

okular shortcut Invert key is:
Ctrl-Alt-i

or

okular menu to change color:
Okular/Settings/ConfigureOkular/Accessibility/ChangeColors/DropDownMenu/...

Color Mode: Normal Colors           = WhitePagePdf  
Color Mode: Invert Luma (Symmetric) = BlackPagePdf  
...   

okular Ctrl-Alt-i
Color Mode: Invert Luma (Symmetric) = BlackPagePdf
is a close match to Terminal screen, except for

  • BrightWhite in Terminal is DullWhite in okular
  • extra Linefeeds

Procedure1:
How to Save the Terminal Output to a Pdf File in Linux?
Konsole terminal / File / Save output as … Ctrl-Shift-s /
HTML document
a.html
open a.html in browser
ctrl-P
PDF Landscape / save as PDF
a.html.pdf
open a.html.pdf with okular

okular Ctrl-Alt-i to change colors

Color Mode: Normal Colors           = WhitePagePdf  
Color Mode: Invert Luma (Symmetric) = BlackPagePdf  
...   

How to match PDF okular colors with Terminal colors?

--

3
  • How about screen capture, pasting the image into an image editor, saving the file and pasting into Okular? OCR to get text. Or use another tool than Okular. Commented Apr 8 at 17:17
  • How about screen capture? screen capture might work for a task that is a one-time task, for a single screen. The task at hand is not a single screen and not a one-time task. Above Procedure1 is relatively easy and many PDF colors do match and PDF copy text works. Procedure1 drawbacks are: some PDF colors do not match and too many Linefeeds in PDF.
    – joseph22
    Commented Apr 8 at 19:43
  • A Question for another time, regarding bash script.sh |& tee /tmp/out.txt How to cat /tmp/out.txt to PDF with matching colors ?
    – joseph22
    Commented Apr 8 at 19:46

0

You must log in to answer this question.

Browse other questions tagged .