-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Using continued with center and right alignment is broken #240
Comments
Yeah, and unfortunately there isn't much we can do about that easily. We would need to not add the last line of a continued section to the document so we could remeasure in the next part. This would involve tracking all sorts of things for the text style and would be a pain. Definitely not impossible, just difficult. The |
I ran into this recently as well. @devongovett Mind if I take a stab at such a text layout system? Have you thought much about possible implementations? Or did you want to go a different direction entirely? |
I also need to be able to use const regular = 'Times-Roman'
const bold = 'Times-Bold'
doc.font(bold)
doc.text('Contact:', { align: 'right', continued: true })
doc.font(regular)
doc.text('[email protected]', { align: 'right' }) |
Any updates regarding this issue? |
Any updates? I also need this feature since I try to use pdfkit with a right-to-left language. For now, I somehow hacked a bit for RTL language but I stuck in the continued option. |
For right aligned texts, I think it is enough to obtain the x position or the width of the last line of the first text. Then we So, is there a way to get the x position or the width of the last line? |
Maybe you can calculate the width of the text according to the fontsize |
I also also need to be able to use align: right along with continued: true. will it be supported? |
Any updates on that? |
Hey all, I created a package to solve this issue. Maybe it helps some of you! |
Are any things new? 😅 |
|
Using continued will not remeasure the text position in order to account for new text being added.
Produces the following:
The text was updated successfully, but these errors were encountered: