View previous topic :: View next topic |
Author |
Message |
max1001
Joined: 16 Dec 2008 Posts: 1
|
Posted: Tue Dec 16, 2008 2:47 pm Post subject: How to add bullet point |
|
|
How do I add a bullet point to a paragraph? An example code will be greatly appreciated. I search for forum for example and came up with none. |
|
Back to top |
|
|
fuzzylintman
Joined: 24 Feb 2009 Posts: 4
|
Posted: Tue Mar 31, 2009 9:25 pm Post subject: Re: How to add bullet point |
|
|
max1001 wrote: | How do I add a bullet point to a paragraph? An example code will be greatly appreciated. I search for forum for example and came up with none. |
I'm no expert, so this may not be the only answer, but I have added bullet points as part of the text... For example:
Code: | AddParagraph(sec, "• Other Comments", true, ParagraphAlignment.Left, 12);
|
(Note that the 'AddParagraph' function is a separate method, not a PDFSharp/MigraDoc function, but it's steps are trivial. Also, it appears that the character is mangled by this forum... it really is a bullet. You should be able to insert these characters in your editor if you are using a decent one.)
-mdb |
|
Back to top |
|
|
fuzzylintman
Joined: 24 Feb 2009 Posts: 4
|
Posted: Tue Mar 31, 2009 11:17 pm Post subject: Re: How to add bullet point |
|
|
max1001 wrote: | How do I add a bullet point to a paragraph? An example code will be greatly appreciated. I search for forum for example and came up with none. |
If you are using MigraDoc, I now see you can also do something like:
Code: | Paragraph p = sec.AddParagraph();
p.AddCharacter(SymbolName.Bullet);
|
|
|
Back to top |
|
|
Thomas Hoevel
Joined: 16 Oct 2006 Posts: 387 Location: Cologne, Germany
|
Posted: Wed Apr 01, 2009 7:39 am Post subject: Re: How to add bullet point |
|
|
max1001 wrote: | How do I add a bullet point to a paragraph? An example code will be greatly appreciated. I search for forum for example and came up with none. |
Here's a sample:
Code: | ListInfo listinfo = new ListInfo();
listinfo.ContinuePreviousList = false;//true for following entries
listinfo.ListType = ListType.BulletList1;
Paragraph paragraph = Document.LastSection.AddParagraph(text);
paragraph.Style = "MyListStyle"; // optional
paragraph.Format.ListInfo = listinfo;
|
This way you get a "real bullet list" if you create an RTF file.
The method described by fuzzylintman works, too.
If you need PDF files, either method can be used. _________________ Regards
Thomas Hoevel
PDFsharp Team |
|
Back to top |
|
|
|