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

ipaddress or uuid string can not wrap correct #890

Closed
lerit opened this issue Mar 1, 2017 · 8 comments
Closed

ipaddress or uuid string can not wrap correct #890

lerit opened this issue Mar 1, 2017 · 8 comments
Labels

Comments

@lerit
Copy link

lerit commented Mar 1, 2017

in table,some text are ip address or uuid string,such as:
67e404e5-d4fb-2732-be14-2f60cf8b3cc2
::ffff:61.50.102.18

version:0.1.26

@liborm85
Copy link
Collaborator

liborm85 commented Mar 4, 2017

Any example?

@lerit
Copy link
Author

lerit commented Mar 5, 2017

you can see,the last but one column,some guid string display not correct
00

@liborm85
Copy link
Collaborator

liborm85 commented Mar 5, 2017

Here it wraps correctly:

var dd = {
	content: [
		{
			table: {
				body: [
					['Text text [67e404e5-d4fb-2732-be14-2f60cf8b3cc2] text text', 'loongtextabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz'],
					['Text Text [67e404e5-d4fb-2732-be14-2f60cf8b3cc2] text', 'text']
				]
			}
		}
	]
}

It is strange that in your table with some wraps correctly and some do not.

@lerit
Copy link
Author

lerit commented Mar 5, 2017

@liborm85 yes, some wraps correctly and some do not
i will copy my json data here ,then you can test it.

@lerit
Copy link
Author

lerit commented Mar 6, 2017

@liborm85
this is my json data:(i just find that remove widths settings will work fine,but why)
var dd = { content: [{ "table": { "headerRows": 1, "widths": [90, 90, 90, 90, 90], "body": [ [{ "text": "account", "bold": true, "fontSize": 12 }, { "text": "opertype", "bold": true, "fontSize": 12 }, { "text": "source", "bold": true, "fontSize": 12 }, { "text": "comment", "bold": true, "fontSize": 12 }, { "text": "datetime", "bold": true, "fontSize": 12 }], ["j", "modify data", "web", "update plan:[9847b959-135a-7014-3ad5-5223f4d2eaf5]", "2017/03/06 09:28"] ] } }] }

@liborm85
Copy link
Collaborator

liborm85 commented Mar 7, 2017

@lerit Pdfmake using the Unicode Line Breaking Algorithm (UAX #14) for splitting words, it is implemented by https://github.com/devongovett/linebreak package. Maybe is linebreak dependecy is some bug.

@liborm85
Copy link
Collaborator

Wrapping is correct for Unicode. How to create a break is described here foliojs/linebreak#7

@liborm85
Copy link
Collaborator

I'm implemented "hard" wrapping if is word too long. See #204 (comment)

@liborm85 liborm85 added the bug label May 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants