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

New line in continued section between 2 text() #1192

Open
krufab opened this issue Dec 8, 2020 · 0 comments · May be fixed by #1193
Open

New line in continued section between 2 text() #1192

krufab opened this issue Dec 8, 2020 · 0 comments · May be fixed by #1193

Comments

@krufab
Copy link

krufab commented Dec 8, 2020

Feature Request

Feature description

It seems it is not possible to easily have multiple columns with multiple formats.
At the moment you can have a long text split in multiple columns if you have:

doc.text(longText, {align: 'justified', columns: 3, columnGap: 15})

However, 2 subsequent text() call will create 2 distinct areas of 3 columns and longText2 will not continue from the same column of longText1.

doc.text(longText1, {align: 'justified', columns: 3, columnGap: 15})
doc.text(longText2, {align: 'justified', columns: 3, columnGap: 15})

A workaround is to use the continued option for the first (or both) instructions. This will make longText2 effectively follow longText1.
However, it seems it is not possible to have a line break between the 2 texts, that is, continue in the same column, but after a new line, to five a sense of different paragraph (texts with new lines at the end are simply trimmed).

doc.text(longText1, {align: 'justified', columns: 3, columnGap: 15, continued: true})
doc.text(longText2, {align: 'justified', columns: 3, columnGap: 15, continued: true})

Would it be possible to introduce a newLine() which continues the same column section, but adds the test on a new line with some indent?

I've created a PR which introduces a new option, lineBreakAfter, which simply adds a new line to the text before closing a section and starting the new continued one. It seems to work, but maybe a specific function would be simplet to use. Also, I managed only to have it working introducing the new line after the text, not before. I believe it would be useful to let the user decide whether to have the text forcing a new line after it, or a new text starting on a new line, depending on the cases.
Let me know if the PR could be useful, so that I can add more documentation.

@krufab krufab linked a pull request Dec 8, 2020 that will close this issue
4 tasks
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 a pull request may close this issue.

1 participant