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

Unclear how to set paper sizes #7

Open
dayglojago opened this issue Jun 22, 2024 · 1 comment
Open

Unclear how to set paper sizes #7

dayglojago opened this issue Jun 22, 2024 · 1 comment

Comments

@dayglojago
Copy link

Hi there!

I'm not sure if this is the correct forum for this question/issue, but I've been using PrintingKit in the same project referenced in issue #6, and after inspecting the code, it's not clear how to change the target text/paper size.

I'd also like to address the margins, because 1" margins on a 2.83" slice of paper is definitely not working :)

In my use case, I'm printing to a thermal receipt printer. The default paper size is 72 mm x 2000 mm or ~2.83" x ~78.74" (the length is basically infinity though, because it can go as long as there's paper left.) However, it seems that PrintingKit defaults to 8.5 x 11" paper, which creates this preview:

Screenshot 2024-06-22 at 1 30 42 PM

And this output:

IMG_2050

As you can see, it does print, although perhaps with less readability than I was hoping. I was looking at maybe using the scale parameter, but I'm not sure that would help with my issues with—for example—overlarge margins.

I've scoured the documentation and the code; it's unclear that there are any other parameters to play around with other than scale. Are different paper sizes supported? Is there a way to set them? I just need the one! :)

@danielsaidi
Copy link
Owner

Hi @dayglojago

For now, some PrintItem cases let you define a print configuration. Perhaps all item types should support it, or perhaps the configuration should be passed into the print function instead?

However, string and attributed string lets you define a PDF page configuration, which currently lets you define page size and page margins.

I haven't experienced the subpar result you shared in the image, but I'm sure there are many caveats when it comes to printing on various printers. :|

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants