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

Add FormattedText to Paragraph by object
https://forum.pdfsharp.net/viewtopic.php?f=2&t=2665
Page 1 of 1

Author:  abam [ Thu Nov 21, 2013 4:24 pm ]
Post subject:  Add FormattedText to Paragraph by object

Hi in my application it would be nice if I did not want to pass the Paragraph that I want to add some text to all over the place.

I just realized that no overload for AddFormattedText actually accepts a FormattedText object.

Is there a way around this, so I can have my own methods return FormattedText objects?

thanks
/adam

Author:  Thomas Hoevel [ Thu Nov 21, 2013 5:05 pm ]
Post subject:  Re: Add FormattedText to Paragraph by object

Hi!

You can use "var ft = new FormattedText()" at one location and "paragraph.Add(ft)" at another place.
Use "ft.Clone()" if you want to add the text more than once.

Add() has overloads for various objects.

Author:  abam [ Fri Nov 22, 2013 1:37 pm ]
Post subject:  Re: Add FormattedText to Paragraph by object

That's great. Exactly what I needed. Thanks!

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