So I'm using AddTabStop to align the second Text on the right side but there is something extra I want since the result its not the best
1. Set max width on the Left Text so in gets smaller, I know I can use RightIndent but then the right text wont go on the right position fully but stop in the Indent.
2. I simply want the right text to always Align on the Top also not in the bottom.
Check images below
I already have done this with drawlines but I had to recreate everything since new pages are not generated automatically. So I desiced to use PDFsharp & MigraDoc
The width is the PDF printer width but I think I have to calculate it different cause its bigger than the printers page width.
Code:
var s = section.AddParagraph(name, "Normal");
s.Format.TabStops.AddTabStop(width - 10, MigraDoc.DocumentObjectModel.TabAlignment.Center);
s.AddTab();
s.AddText(price);
The one I created with drawline and MeasureString. But I have to rewrite everything to count for the new page generation. Maybe I can use it the document graphics with MigraDoc?
The one I made with MigraDoc I need to make it like the one I made with Drawlines
It also can help if you could tell me a method to know when to generate a new page.
The one I though is make stringbuilder and count each line with measure string. When the Y of the string position is higher than the page height and cant fit make a new page.
But to count each line when string doesnt fit I have to measure it again and again so I got to split it in lines.
Like how MigraDoc knows when to change the page? It measures the string like I thought of doing?