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

Add custom style and margin to ToC line #1108

Merged
merged 5 commits into from
Aug 21, 2017
Merged

Conversation

boiving
Copy link
Contributor

@boiving boiving commented Aug 18, 2017

I add custom style to ToC list.

I add few key in node to keep style and margin. You can find it in the exemple file.
I think a better way can be to replace string in tocItem by object containing label, style and margin but there is more change to do and i want to have a first, very simple version.

Regards

@liborm85
Copy link
Collaborator

Please revert changes in build folder.

Then numberStyle property not work.

@boiving
Copy link
Contributor Author

boiving commented Aug 21, 2017

I revert changes in build folder.

I fix a margin problem with the number when toc line text use margin.
I test the numberStyle property with color and bold, and it work fine with the last fix.
Can you give me more details about the "not working" issue ?

@liborm85
Copy link
Collaborator

liborm85 commented Aug 21, 2017

Column with page numbers can not be styled.

Here is usage numberStyle:

{
  toc: {
    title: {text: 'INDEX', style: 'header'},
    numberStyle: {bold: true}
  }
}

But page numbers is not bold.


I see it. In source code is this:
var numberStyle = node.numberStyle || {};

But numberStyle is in toc element, then there should be something like this:
var numberStyle = node.toc.numberStyle || {};

@boiving
Copy link
Contributor Author

boiving commented Aug 21, 2017

Yes, indeed.

My mistake... I don't report my fix from my test project which work fine to the pdfmake project.
It's done now.

Thanks

@liborm85 liborm85 merged commit bebe222 into bpampuch:master Aug 21, 2017
@liborm85
Copy link
Collaborator

Merged. Thanks.

touchaqb pushed a commit to touchhealth/pdfmake that referenced this pull request Nov 22, 2017
* Add custom style and margin to toc element

* Update exemple and build

* Fix toc number margin

* Revert build folder

* Fix numberStyle
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 this pull request may close these issues.

2 participants