PDFsharp - moved to http://forum.pdfsharp.net/ Forum Index PDFsharp - moved to http://forum.pdfsharp.net/
Please visit the new PDFsharp forum at http://forum.pdfsharp.net/
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

MigraDocLite and Subscript

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    PDFsharp - moved to http://forum.pdfsharp.net/ Forum Index -> Support - moved to http://forum.pdfsharp.net/
View previous topic :: View next topic  
Author Message
rb7smutje



Joined: 09 Apr 2008
Posts: 2

PostPosted: Thu Apr 10, 2008 12:24 am    Post subject: MigraDocLite and Subscript Reply with quote

Is there any way to format text in subscript with MigraDocLite?

For example:
Code:

paragr.AddFormattedText("irgendwas", TextFormat.Bold);

This methode doesn't offer subscript.

But I found this methode for example:
Code:

FormattedText ftext = new FormattedText();
ftext.Subscript = true;

But I don't know how to us this method in a Paragraph. How can I call this?

Anyone knows the trick or has any Idea?



Thanks a lot for this really good project!
Back to top
View user's profile Send private message
Thomas Hoevel



Joined: 16 Oct 2006
Posts: 387
Location: Cologne, Germany

PostPosted: Thu Apr 10, 2008 8:35 am    Post subject: Reply with quote

Hello!

You can't always get what you want ...
... but you get what you need ...

All the AddXXX methods return the newly added object and thus allow further modifications:
Code:
FormattedText ftext = paragr.AddFormattedText("irgendwas", TextFormat.Bold);
ftext.Subscript = true;

This trick works with paragraphs, formatted text, textframes, rows, columns, ...
Otherwise there would have to be lots of overloaded AddXXX methods with lots of different parameter sets ...
_________________
Regards
Thomas Hoevel
PDFsharp Team
Back to top
View user's profile Send private message Visit poster's website
rb7smutje



Joined: 09 Apr 2008
Posts: 2

PostPosted: Thu Apr 10, 2008 9:46 pm    Post subject: Reply with quote

If thought the text was this:
...you don't get what you need...

But here it is opposite.

Thank you very much!
Great work.


Regards!
Back to top
View user's profile Send private message
Thomas Hoevel



Joined: 16 Oct 2006
Posts: 387
Location: Cologne, Germany

PostPosted: Mon Apr 14, 2008 9:01 am    Post subject: Reply with quote

rb7smutje wrote:
If thought the text was this:
...you don't get what you need...

I had an old Rolling Stones song on my mind ... Wink
_________________
Regards
Thomas Hoevel
PDFsharp Team
Back to top
View user's profile Send private message Visit poster's website
PeterMueller



Joined: 04 Dec 2008
Posts: 4

PostPosted: Thu Dec 04, 2008 11:30 am    Post subject: Reply with quote

Hello,

I want to use subscript in a cell of a table.

Thomas Hoevel wrote:

... All the AddXXX methods return the newly added object and thus allow further modifications:
Code:
FormattedText ftext = paragr.AddFormattedText("irgendwas", TextFormat.Bold);
ftext.Subscript = true;

This trick works with paragraphs, formatted text, textframes, rows, columns, ...


I tried it this way:
Code:
FormattedText ftext = cell.AddFormattedText("x1", TextFormat.Bold);
ftext.Subscript = true;

Unfortunately the Compiler complains "'MigraDoc.DocumentObjectModel.Tables.Cell' enthält keine Definition für 'AddFormattedText'." (= "'MigraDoc.DocumentObjectModel.Tables.Cell' does not contain a definition for 'AddFormattedText'.") Is there any workaround for my problem? Any help is welcome!
Back to top
View user's profile Send private message
Thomas Hoevel



Joined: 16 Oct 2006
Posts: 387
Location: Cologne, Germany

PostPosted: Thu Dec 04, 2008 12:04 pm    Post subject: Reply with quote

First add a paragraph to the cell:
Code:
Paragraph paragraph = cell.AddParagraph()


Then add the formatted text to that paragraph.
_________________
Regards
Thomas Hoevel
PDFsharp Team
Back to top
View user's profile Send private message Visit poster's website
PeterMueller



Joined: 04 Dec 2008
Posts: 4

PostPosted: Thu Dec 04, 2008 1:12 pm    Post subject: Reply with quote

Thanks a lot! Is it possible to avoid the linebreak? I want to write "lx1" in the cell of a table, "x1" as subsript.

By writing the following
Code:

cell.AddParagraph("l");
Paragraph paragraph = cell.AddParagraph();
FormattedText ftext = paragraph.AddFormattedText("x1", TextFormat.Bold);
ftext.Subscript = true;


the result is:
"l"
"x1" (with a linebreak).
Back to top
View user's profile Send private message
Thomas Hoevel



Joined: 16 Oct 2006
Posts: 387
Location: Cologne, Germany

PostPosted: Thu Dec 04, 2008 2:48 pm    Post subject: Reply with quote

Yep:
Code:

Paragraph paragraph = cell.AddParagraph("l");
FormattedText ftext = paragraph.AddFormattedText("x1", TextFormat.Bold);
ftext.Subscript = true;

_________________
Regards
Thomas Hoevel
PDFsharp Team
Back to top
View user's profile Send private message Visit poster's website
PeterMueller



Joined: 04 Dec 2008
Posts: 4

PostPosted: Thu Dec 04, 2008 4:00 pm    Post subject: Reply with quote

Thank you very much, keep up the great work and greetings to the Domstadt!
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    PDFsharp - moved to http://forum.pdfsharp.net/ Forum Index -> Support - moved to http://forum.pdfsharp.net/ All times are GMT
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum


Powered by phpBB © phpBB Group. Hosted by phpBB.BizHat.com


Start Your Own YouTube Clone

Free Web Hosting | Free Forum Hosting | FlashWebHost.com | Image Hosting | Photo Gallery | FreeMarriage.com

Powered by PhpBBweb.com, setup your forum now!
For Support, visit Forums.BizHat.com