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

Example for printing the labels on A4 paper size (Can be used for any other paper size) #20

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

semir-t
Copy link

@semir-t semir-t commented Jul 10, 2022

I have a regular printer and I have acquired sticker labels on the A4 paper ( something like this )

So I used this library to create the PDF for this type of paper and I think that this could be useful for other people as well. In this pull request I have only created the example for the A4 paper, but inside the Readme there is description on how to use this example to generatethe PDF for any paper size (A4,A3,A2 etc.)

@semir-t
Copy link
Author

semir-t commented Jul 18, 2022

@veghp to review.

@veghp
Copy link
Member

veghp commented Jul 20, 2022

Hi thanks, yes I received notification about it. While the examples are about usage of the software functionalities, I agree perhaps there should be one on formatting the output. There were questions before about the borders etc.

The append code block is probably better done in a loop (a1f458d#diff-26fc4154a85945e2b6be9754927923f321edfd5501040f7b6fb3c3e916353a61R7).

Could you please run a spellcheck on all committed text and fix the typos? Then I can merge it after trying out the code.

Thanks for the contribution

@semir-t
Copy link
Author

semir-t commented Jul 21, 2022

Hi @veghp. Implemented the code in a loop and also fixed the typos.

veghp added a commit that referenced this pull request Jul 22, 2022
Fix typos and format to black.
@veghp
Copy link
Member

veghp commented Jul 22, 2022

Thanks for the effort. I merged to dev and will form part of the next release.

@DexterAntonio
Copy link

DexterAntonio commented Apr 25, 2023

Thank you for posting this solution. It is nearly exactly what I am looking for. I have one question. Is there a way to add a margin around the page? I tried changing the page css attribute to

@page {
    width: 0.6in;
    height: 11in;
    margin-top:10in;
    margin-left:0.435in;
    margin-right:0.435in;
    margin-bottom:0.6in;
}

but the margin was still missing from the final pdf.
I am trying to print labels to this type of sheet, so being able to specify the margin is critical.

Thank you!

@semir-t
Copy link
Author

semir-t commented Apr 26, 2023

Hi ,if you use following configuration inside the .css file:

@page {
    width: 8.5in;
    height: 11in;
    padding-top:0.6in;
    padding-left:0.435in;
    padding-right:0.435in;
    padding-bottom:0.6in;
}

You get the following output:
Screenshot from 2023-04-26 09-04-38

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

Successfully merging this pull request may close these issues.

None yet

3 participants