PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Mon Jul 15, 2024 11:28 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Mon Nov 08, 2010 6:39 pm 
Offline

Joined: Thu Aug 19, 2010 7:58 pm
Posts: 10
Hello, i'm french (sorry for my english :oops: ) and i have a question.

The TextFormatter do back on line automatically but i want to know the number of lines display or height of text ?

Thank you.


Top
 Profile  
Reply with quote  
PostPosted: Wed Nov 10, 2010 9:33 am 
Offline
Supporter

Joined: Fri May 15, 2009 3:28 pm
Posts: 96
Hi,

are you trying to find a way to trim text to a particular height? or do you just want to know the height for another reason?

If its trimming the text, I encountered this issue when I was trying to print a "fixed" layout pdf page where the data was frequently longer than the space allowed.

Let me know and I will try to help.

Thanks,

Mike


Top
 Profile  
Reply with quote  
PostPosted: Wed Nov 10, 2010 5:28 pm 
Offline

Joined: Thu Aug 19, 2010 7:58 pm
Posts: 10
Hi, thanks for your reponse.

I create invoices (bill) dynamically.

In the description column, the text length is variable.
So I must know the number line of this item or I have to put the next item.

Do you understand why I need to know the real heigth of the textformatter ?

Thanks for the futur reply.


Top
 Profile  
Reply with quote  
PostPosted: Thu Nov 11, 2010 9:23 am 
Offline
Supporter

Joined: Fri May 15, 2009 3:28 pm
Posts: 96
Hi,

you should use MigraDoc for this. I always create a MigraDoc.DocumentObjectModel.Tables.Table object, then add rows/columns to this. Then in each cell I add a MigraDoc.DocumentObjectModel.Paragraph object, then add my text to the Paragraph using the myparagraph.AddFormattedText("text", migraDocFont); function. The table/paragraph objects will then handle all the height formatting for you - you just need to put text in the correct paragraphs.

I only use PdfSharp for drawing graphics directly (i.e. line graph etc.) onto a page. for everything to do with text, I always use MigraDoc. Look at the MigraDoc samples as i believe they cover tables etc.

Hope this helps.

Mike


Top
 Profile  
Reply with quote  
PostPosted: Thu Nov 11, 2010 12:19 pm 
Offline

Joined: Thu Aug 19, 2010 7:58 pm
Posts: 10
Thanks for your reply.

Effectively, i used the bad librairy.

With MigraDoc it's easier for create an invoice.

Thank again


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 28 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:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group