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

Column headings in tables are partially bold #35

Open
madVis opened this issue Sep 29, 2024 · 9 comments
Open

Column headings in tables are partially bold #35

madVis opened this issue Sep 29, 2024 · 9 comments

Comments

@madVis
Copy link

madVis commented Sep 29, 2024

Hi

I'm trying to print a table like:

const tableHeaderArray = [
      { width: 7, align: 'left' },
      { width: 7, align: 'left' },
      { width: 7, align: 'right' }
    ];

    const tableBodyArray = [
      [
        (encoder) => encoder.bold(true).text('BoldHeadingName').bold(false),
        (encoder) => encoder.bold(true).text('BigHeadingOccupies3Lines').bold(false),
        (encoder) => encoder.bold(true).text('QuantityInBold').bold(false)
      ],
      [
        'Banana',
        'doz',
        '2'
      ],
      [
        'Cherry',
        'kg',
        '1'
      ]
    ];

When the header takes multiple lines only the last two lines are getting bold in the below print

Expected result: the first 2 lines should also be bold

IMG_0464

@NielsLeenheer
Copy link
Owner

I am not seeing this issue (anymore?)

To be fair, my local code has gone though quite a bit of work since the 3.0.1 release and will land on the main tree later this week, including a really handy debugging tool.

playground

@madVis
Copy link
Author

madVis commented Sep 30, 2024

Thanks for the update, appreciate it. The debugging tool sounds cool, looking forward to trying it out. I’ll test again once the new changes are available and update.

@NielsLeenheer
Copy link
Owner

NielsLeenheer commented Sep 30, 2024

All the recent changes have landed now, including the playground tool (in the tools directory). A hosted copy is also available at: https://point-of-sale.dev/receipt-printer/playground

@madVis
Copy link
Author

madVis commented Oct 1, 2024

Hey, Thanks for the update and for introducing the playground tool—it's really helpful!

I tested using the latest changes and still seeing the issue.
From the playground, the bold text appears correctly in the preview but it prints without the bold formatting when I use the printer from the playground.
I also tried using a different printer but the same result occurred.

Screenshot 2024-10-01 at 1 57 52 PM

@NielsLeenheer
Copy link
Owner

The playground gives the right rendering and the commands also seem to look right. I've tested it on multiple printers and they all print with the full header in bold.

So I am thinking it is the printer.

Which type of printer are you using? And when you said you tested multiple printers, were they the same type or manufacturer?

@madVis
Copy link
Author

madVis commented Oct 4, 2024

Printers are from different manufacturers. Tried on a local printer Shreyans MPT-III and Everycom EC400

@madVis
Copy link
Author

madVis commented Oct 14, 2024

Hey @NielsLeenheer, I hope you're doing well! I was wondering if there are any updates on when the latest version of the library will be available?

@NielsLeenheer
Copy link
Owner

If the playground shows it the right way, but the printer shows in a different way, than I am afraid it is the printer that is at fault. Some printers follow the ESC/POS specifications better than others. And there is very little I can do to work around it, as changing something for your printer will break stuff for others. I personally know the MPT-II printer is very peculiar, so the MPT-III may also have the same issues.

@madVis
Copy link
Author

madVis commented Oct 29, 2024

Hey @NielsLeenheer
Since the bug is due to printer limitations, I can work around it for now. Thanks for looking into it.
Do you have an ETA for the 3.0.2 release? Thanks!

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