Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add --margin option #49

Open
anarcat opened this issue Mar 3, 2023 · 4 comments
Open

add --margin option #49

anarcat opened this issue Mar 3, 2023 · 4 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@anarcat
Copy link
Contributor

anarcat commented Mar 3, 2023

Hi,

I've tried printing a PDF document generated by qr-backup and i'm struggling with my printer. It looks like the document expects the printer to be able to do "full bleed": there's no margin around the edges. This cuts off the letters "S" and "t" in the "Step" words and a good chunk of the left qrcodes, which make the entire left columns of the qrcodes unusable.

And just to be clear here: I hate printers. They never work. But in this specific case, the output of paperbackup actually prints fully while qr-backup fails halfway through, I think because of the layout issue.

I suggest adding a border around the PDF to workaround this problem.

@za3k
Copy link
Owner

za3k commented Mar 3, 2023

There is a one-pixel rectangular box printed around the entire outside border to help with debugging this. Do you see any of the four sides?

@za3k za3k added enhancement New feature or request good first issue Good for newcomers labels Mar 3, 2023
@za3k
Copy link
Owner

za3k commented Mar 3, 2023

That said, while the problem is almost certainly that your printer is configured wrong, I'm sure you're not the only person that would rather pass --margin 10px than reconfigure your printer exactly right. I think this is a reasonable request still.

@anarcat
Copy link
Contributor Author

anarcat commented Mar 3, 2023

Your printer is configured wrongly, most likely.

printers, as a rule of thumb, are generally misconfigured. they are hell on earth and I don't understand why, decades into the computing age, we haven't fixed printers yet. but so is life, i'm happy i can print anything on this thing.

There is a one-pixel rectangular box printed around the entire outside border to help with debugging this. Do you see any of the four sides?

so interestingly, now i can print something with qrbackup. i made a test with a smaller file that generated less qrcode boxes, and that seems to have made the printer happier. but there's definitely not a border on all sides, and it's misaligned.

here's what it looks like from my phone:

PXL_20230303_155206512

amazingly, this actually scans properly and restores, which i'm really surprised about. it looks like it manages to recover everything just with the middle "parity" code. not sure with the right-side code isn't scanning properly either.

but yeah, you can see something is clearly off with the layout here.

https://github.com/za3k/qr-backup/blob/master/docs/FAQ.md#when-i-print-a-page-part-of-it-is-cut-off

so i looked at the --page setting and i'm a little confused. the default is 500x600px, which doesn't look like a page geometry at all... i would have expected something like 850x1100 or something like that... what do those numbers represent?

evince tells me the generated PDF is 172x212mm which just seems like a really odd paper size. it also doesn't match the 500x600 ratio either.

https://github.com/za3k/qr-backup/blob/master/docs/FAQ.md#how-do-i-find-the-maximum-dimensions-of-my-printer

Modern printers are "driverless" and do not ship PPD files anymore, which makes "experiment with --page" the only option. It would be lovely to know how we're supposed to experiment with that or what the option actually means. :) The manual page only says:

       --page WIDTH_POINTS HEIGHT_POINTS
              Sets the usable size of the paper on your printer.  This  should
              NOT be 8.5 x 11 -- make sure to include margins.  Default: 500px
              x 600px

... and that doesn't actually explain how this should be calculated. Also, the usage mentions "POINTS" but then the default is in "px", which are two entirely different thing as I understand it...

That said, while the problem is almost certainly that your printer is configured wrong, I'm sure you're not the only person that would rather pass --margin 10px than reconfigure your printer exactly right. I think this is a reasonable request still.

yeah, so i only have so much time in my life, and don't generally spend that time entertaining long term relationships with my printers (partly because it's really just a one-way relationship where i do all the work and all they give me are shredded papers most of the time).

so yeah, i think a --margin would be great. this is something @misaki-web also suggested in #21 from what i can tell. :)

@za3k za3k changed the title add margin around PDF? add --margin option Aug 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants