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

Line feed is not respected in cells #16

Open
rmattler opened this issue Apr 20, 2017 · 2 comments
Open

Line feed is not respected in cells #16

rmattler opened this issue Apr 20, 2017 · 2 comments

Comments

@rmattler
Copy link

Text with line breaks is not show in the cell.

Code:
String s = "Policies \n and \n Proc, ";

y = lp.putRow(pMargin, y, Cell.of(headingCell20, colWidths[0], heading20, s));

I'm expecting:

Policies
and
Procs

Instead I get:

Policies and Proc

Is this intentional or a bug?

@GlenKPeterson
Copy link
Owner

You can split your input string on the \n so that "Policies\n and\n Procs" becomes ["Policies", "and", "Procs"] and pass that array to cb.add(). Or perhaps something like:

StringTokenizer sT = new StringTokenizer("Policies\n and\n Procs");
CellBuilder cb = n.cellBuilder().align(TOP_LEFT);
while (sT.hasMoreTokens()) { 
    cb.add(sT.nextToken());
}
cb.buildCell()

I think that recognizing \n internally would be a great new feature.

@rmattler
Copy link
Author

rmattler commented Apr 20, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants