PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Fri Jun 23, 2017 10:21 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Thu Mar 30, 2017 9:03 am 
Offline

Joined: Thu Mar 30, 2017 8:53 am
Posts: 2
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


Top
 Profile  
Reply with quote  
PostPosted: Thu Mar 30, 2017 11:26 am 
Offline
empira Employee
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 2659
Location: Cologne, Germany
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.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Thu Mar 30, 2017 11:54 am 
Offline

Joined: Thu Mar 30, 2017 8:53 am
Posts: 2
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


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group