Skip to content

Left most column in Generator.row not left-aligned properly #20

@fzl-22

Description

@fzl-22

Hi, thanks for developed this cool library!

I got an issue when I use generator.row and generator.textLeftRight to print a row, the leftmost column is not left-aligned properly.

WhatsApp Image 2024-05-19 at 11 31 57 AM(1)

Here is my code:

      bytes += _generator.hr(ch: '=');
      final receiptNumber = label.receiptNumber;
      final shippingTotalWeight = '${label.shippingTotalWeight} kg';
      final shippingCost = Formatter.currency(label.shippingCost as int);
      bytes += _generator.row([
        PosColumn(
          text: 'Pengiriman',
          width: 6,
        ),
        PosColumn(
          text: receiptNumber,
          width: 6,
          styles: const PosStyles(align: PosAlign.right),
        ),
      ]);
      bytes += _generator.textLeftRight('Berat', shippingTotalWeight);
      bytes += _generator.textLeftRight('Ongkir', shippingCost);
      bytes += _generator.hr();bytes += _generator.hr(ch: '=');

Here is my Generator configuration:

  @preResolve
  Future<Generator> get generator async => Generator(PaperSize.mm80, await CapabilityProfile.load());

and I used CP1252 global code table.

Is there any way to fix this? Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions