l9c / tmux_cheat_sheet_data

tmux cheat data
https://tmuxcheatsheet.com
127 stars 19 forks source link

Printing out of site #15

Closed StakFallT closed 3 months ago

StakFallT commented 4 months ago

I'm not sure if this is the proper place for this since this repo seems more about the data https://tmuxcheatsheet.com/ uses than the site itself, but I know if one never asks, it definitely will never get done :P But as a more practical reason, it'd be great to be able to print out the sheet with the formatting as it is on the page so that it can be stored in like a binder on the desk with other cheat sheet-like references. For now, I know that screen captures and printing the images are a workaround. However, printing images means technically the white background of the page is actually "getting printed" (even if it's nothing) -- meaning, visually sure it may look the same but it's not actually the same. Additionally, it may use more up more memory spooling the print job. When printed to PDF, the print preview looks like this:

tmuxcheatsheet com print preview - Screenshot_2024-07-19_08-15-25

Obviously, that's super not-helpful. I've looked around online a bit and many people reference (when dealing with print questions in general) creating a stylesheet with media=print or something, but the implementations I've seen using that require the file to be hosted somewhere and from what I understand, it can't be local, as the browser is sandboxed from being able to ingest anything on the local filesystem for security purposes. So unless there's a way to specify media=print and inline the thing so that it can be injected via developer tools, there doesn't seem to be an easy way to achieve printing the page and storing it in a nice physical reference manual to be put on the desk which is a pretty big bummer since I'm using tmux more and more over screen and byobu and consider tmux one of my best-of-breed tools in my overall tool / utility toolbox.

l9c commented 4 months ago

The cheat sheet is indeed designed for an interactive experience within web browsers. Since this issue has been raised before (#9 ), I'm currently reevaluating it. Thank you for the feedback.

StakFallT commented 4 months ago

Awesome, thanks so much! I'm sorry I didn't search. I'm so used to repos having a bunch of different issues open, that when I saw nothing opened, I assumed (incorrectly) that the issue system for the repo didn't really get used.

I looked over #9 as you linked and it indeed is exactly the same request as mine (not that I had any doubts -- I just wanted to do my due diligence and check the details of the previously made request :) ). It appears as though there was no follow up with respect to the suggested workaround (to hit ctrl+p to save as a PDF). Initially, I was going to say this issue could be closed and #9 left open, but #9 is closed and the workaround stated in #9, unfortunately, at least for me, results in the image I attached in my opened issue. So in a sense, the "issue" is still pending a resolution.

l9c commented 3 months ago

The site is now ready for printing.

pzhlkj6612 commented 3 months ago

The site is now ready for printing.

It works! However, Google's ads occupy some space on the paper. Is there a way to remove them when printing?

The screenshot of Google Ads on the paper

.

l9c commented 3 months ago

The site is now ready for printing.

It works! However, Google's ads occupy some space on the paper. Is there a way to remove them when printing?

The screenshot of Google Ads on the paper

.

Should be fixed now. Thank you for the feedback!

pzhlkj6612 commented 3 months ago

It works! However, Google's ads occupy some space on the paper. Is there a way to remove them when printing?

Should be fixed now.

I can confirm that those ads are not on the printed pages now.

The screenshot of the clean paper

.

StakFallT commented 3 months ago

This still doesn't work for me on Chromium on Linux; it's still the same effect; it looks like the browser shown by pzhlkj6612 is using Edge. As a result, I think this should be re-opened as the issue still persists.

Here's another screenshot of the print preview dialog with the attempted date / time: image

I've tried setting the printer to my HP LaserJet P4014 to see if maybe the driver is causing the parsing issue, but that was the same effect. If it helps, I'm on Manjaro using Chromium. Here's the info from my Chromium browser's about page:

Chromium Version 122.0.6261.69 (Official Build) Arch Linux (64-bit)

And here's the info from "inxi --system" image

From uname -a Linux Fawkes1 5.17.15-1-MANJARO #1 SMP PREEMPT Wed Jun 15 07:09:31 UTC 2022 x86_64 GNU/Linux

From cat /etc/issue Manjaro Linux \r (\n) (\l)

No extensions installed on this Chromium user profile either (minus the one that comes with Chromium, and I tried turning that off to see if it had any difference, and it's still the same effect): image

pzhlkj6612 commented 3 months ago

it looks like the browser shown by pzhlkj6612 is using Edge.

Yes, I was using Microsoft Edge on Linux and Windows.

This still doesn't work for me on Chromium on Linux;

I'm using Google Chrome 127.0.6533.73 on Windows 11 and don't see the wrong layout:

The screenshot of the printing dialog on Google Chrome on Windows 11

Maybe this is a Chromium-only defect?

.

l9c commented 3 months ago

check Background Graphics in More Settings @StakFallT

StakFallT commented 3 months ago

I just tried that and this was the result: image

For comparison (when setting it to my HP LaserJet P4014): image

Granted, it makes it easy to read due to the contrasted backgrounds on the various entries, but it's still not like what I see on the page (two columns)

StakFallT commented 3 months ago

pzhlkj6612

I don't think it's a Chrome / Chromium issue, because I just tried it with Chrome Version 120.0.6099.216 (Official Built) (64-bit), FireFox (123.0 (64-bit) Mozilla Firefox for Manjaro Linux, thinking maybe it's just Chromium, and Chrome and Firefox both also have the issue as well. I could try something like Opera, but I suspect the issue will be present there as well, and if it's not it would likely be something Opera would be doing to correct something.

pzhlkj6612 commented 3 months ago

@StakFallT

but it's still not like what I see on the page (two columns)

The page size of "latter" is a bit small, please try the "A3" paper or use the "landscape" layout instead.

I don't think it's a Chrome / Chromium issue

I think I9c is right. That's because of the "Background Graphics" setting.

StakFallT commented 3 months ago

I wasn't able to set it to A3 using my print driver, but I was able to using Save to PDF. I then opened the PDF in a reader and was able to get a preview of what I expected it should look like! It seems the A3 thing was the culprit. Thanks!

pzhlkj6612 commented 3 months ago

@StakFallT , don't forget to try the "landscape" layout.