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 

Get Paragraph Text

 
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
interpeo



Joined: 27 Sep 2008
Posts: 1

PostPosted: Sat Sep 27, 2008 3:26 pm    Post subject: Get Paragraph Text Reply with quote

Hi all,

I tried a very simple task without success. Sad

How can I get the text of a Paragraph, for example after I write the fallawing code:

row.Cells[0].AddParagraph("pdfsharp")

I don't see a property like: row.Cells[0].Text / Value

Thanx a lot, great library!

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



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

PostPosted: Mon Oct 06, 2008 1:10 pm    Post subject: Reply with quote

A cell can contain more than simple text.

IIRC you'll find it in row.Cells[0].Elements.

In your case there should be one Paragraph object, but complex cells may contain several (potentially nested) elements.
You can even have a table in a cell ...
_________________
Regards
Thomas Hoevel
PDFsharp Team
Back to top
View user's profile Send private message Visit poster's website
PeterGillespie



Joined: 14 Oct 2008
Posts: 8
Location: England

PostPosted: Thu Oct 23, 2008 8:47 am    Post subject: Reply with quote

This is how I did it:

Code:

StringBuilder allTextInParagraph = new StringBuilder();
 foreach (DocumentObject element in _paragraph.Elements)
 {

    if (element is MigraDoc.DocumentObjectModel.Text)
   {

     MigraDoc.DocumentObjectModel.Text textObj =
                                  (MigraDoc.DocumentObjectModel.Text)element;

     allTextInParagraph.Append(textObj.Content);
   }
}
Back to top
View user's profile Send private message
Orestone



Joined: 24 Oct 2008
Posts: 7
Location: Brisbane, Australia

PostPosted: Mon Mar 23, 2009 6:24 am    Post subject: Table in a Cell Reply with quote

Thomas Hoevel wrote:
... You can even have a table in a cell ...


Not sure this is an appropriate place to ask this but how do I put a Table in a Cell as hinted above?

The following does not compile
Code:
var cell = new Cell;
cell.AddTable();

as AddTable is not a method of the class Cell.

I understand from another post of mine http://pdfsharp.s3.bizhat.com/viewtopic.php?p=1610#1610 that I can embed a Table in a TextFrame but if I do that I end up with the following hierarchy:
Code:
Cell
|_TextFrame (containing a single cell table)
  |_Table (1x1) containing another table/textframe combo
    |_TextFrame
      |_Table (rows_N x cols_M)


This hierarchy quickly gets very confusing and with nested tables and worse (for me), the TextFrame does not expand to the size of the embedded table (like it does if it simply contained paragraphs) so the following rows in my outer level table overlay those of the inner table.

So the question is: Is it possible to add a Table to a Cell of a containing table and have the containing table expand with the embedded table?
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