PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Wed Feb 08, 2023 5:23 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Tue Sep 06, 2022 11:49 am 
Offline

Joined: Tue Sep 06, 2022 11:34 am
Posts: 2
I recently started a project using PDF sharp + Migra Doc and I encounter a problem which I have seen in other posts, there is no fixing automatically. Table row will be generated on the next page if it doesn't have enough space and if there is still not enough space it will just go into the border and the text is lost. I am thinking of a workaround but I am not sure exactly how it can be done.

My think is as follows:

If I am able to check how many lines of text can fit in cell with the given string I can create a variable and increase it every time I add text. with the excess of text I can simply create a new row (which will be automatically be added on the next page) and thus fixing my problem. Even if I am not counting lines, is there a way to check if the row becomes too large for the current page? If at a given time I can check if the cell is too large and will be automatically sent to the next page I can trim the string up to the point it will fit, save the remaining words that didn't fit and maximise the space within the page.


Attachments:
pdfsharp.PNG
pdfsharp.PNG [ 30.08 KiB | Viewed 506 times ]
Top
 Profile  
Reply with quote  
PostPosted: Tue Sep 06, 2022 12:26 pm 
Offline
PDFsharp Expert
User avatar

Joined: Sat Mar 14, 2015 10:15 am
Posts: 759
Location: CCAA
Also discussed here:
https://stackoverflow.com/a/73621811/162529

_________________
Best regards
Thomas
(Freelance Software Developer with several years of MigraDoc/PDFsharp experience)


Top
 Profile  
Reply with quote  
PostPosted: Tue Sep 06, 2022 12:53 pm 
Offline

Joined: Tue Sep 06, 2022 11:34 am
Posts: 2
That is my post and the response does not work, is it possible to retrieve the cell height or at least row height? row.Height.value brings back 0 as well as row.Height.centimetres before rendering. Thank you


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 22 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