Skip to content

Multi line text keeps spaces at the end of lines which makes center alignment off-center #1174

@dontwork

Description

@dontwork

Bug Report

I have a box image I am rendering to a PDF and I am attempting to render some multi-line text which renders within that box and is centered. The first line of this text on the generated pdf has a space at the end which I believe is what is affecting the alignment of the text. Initially I observed that the text is slightly left of center and I believe that this space at the end of the line may be what is causing it. I can confirm the existence of the space character by highlighting that area of the pdf

Description of the problem

align:center on multiline is a little bit off to the left potentially due to spaces at the end of lines

Code sample

Your environment

  • pdfkit version: latest
  • Node version: 12
  • Browser version (if applicable): n/a
  • Operating System: Windows

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