PDFsharp & MigraDoc Foundation
https://forum.pdfsharp.net/

MigraDoc and Numbered headings
https://forum.pdfsharp.net/viewtopic.php?f=2&t=3562
Page 1 of 1

Author:  MichaelH [ Thu Mar 30, 2017 9:03 am ]
Post subject:  MigraDoc and Numbered headings

Hi,

I can't work out how to create Heading styles that are numbered. Like Word for example.
1 Heading
1.1 Sub Heading
1.1.1 Sub sub heading

Maybe my google mojo is weak, but found nothing.

I've tried setting the ListType to NumberList1 (<myheadingstyle>.ParagraphFormat.ListInfo.ListType = ListType.NumberList1;) but that didn't work.

Is it possible using MigraDoc?

Using (nuget) PDFsharp-MigraDoc-GDI 1.32.4334 with c# in VS2015.

TIA/
Michael

Author:  Thomas Hoevel [ Thu Mar 30, 2017 11:26 am ]
Post subject:  Re: MigraDoc and Numbered headings

Hi, Michael!
MichaelH wrote:
I've tried setting the ListType to NumberList1 (<myheadingstyle>.ParagraphFormat.ListInfo.ListType = ListType.NumberList1;) but that didn't work.
Maybe that's not enough.
I think you have to add a ListInfo object.
See also (bullet list, not numbered list):
http://stackoverflow.com/a/4062368/162529

I don't think it will work for headings as you expect it to work.
Nested numbered lists should work with the RTF renderer, but AFAIK they do not work with the PDF renderer.

Is it possible to add the numbers from your code?
That's what I would do.

Author:  MichaelH [ Thu Mar 30, 2017 11:54 am ]
Post subject:  Re: MigraDoc and Numbered headings

Yeah, your are right. :)

Adding it in code was quite easy..

hehe, I've spent at least ten times googling for it than simply adding it using code. Oh well, never too old to learn, eh?

Thank you/
Michael

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/