PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Fri Apr 19, 2024 5:59 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Underline to end of line
PostPosted: Thu Jun 09, 2016 1:33 pm 
Offline

Joined: Thu Jun 09, 2016 1:17 pm
Posts: 2
Hi.
How can i do underline to end of line?
some text . . . . . . . . . . . . | - end of Page (document.DefaultPageSetup.RightMargin)
Dotes mean space.
I want see this
some text________________|

I tryed to use TabStops but underline's line is upper TabStop's line
paragraph = section.AddParagraph("Hello, World!");
paragraph.Format.TabStops.ClearAll();
paragraph.Format.TabStops.AddTabStop("16cm", TabAlignment.Right, TabLeader.Lines);
paragraph.AddTab();


Another question.
Can i change distance from text and underline?

Thank you.


Top
 Profile  
Reply with quote  
PostPosted: Thu Jun 09, 2016 1:58 pm 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3096
Location: Cologne, Germany
Hi!

I think using a TabStop would be a clean way of doing this.
If lines are at different heights then please use the Issue Submission Template so we can investigate this.
viewtopic.php?f=2&t=832

Another option could be a bottom border of the paragraph.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Thu Jun 09, 2016 2:57 pm 
Offline

Joined: Thu Jun 09, 2016 1:17 pm
Posts: 2
I prepared mdddl file with my problem.

I noticed that different font names have different gap between underline and text.
Is any way to changing this gap?

Thank you.


Attachments:
template.zip [545 Bytes]
Downloaded 353 times
Top
 Profile  
Reply with quote  
PostPosted: Thu Jun 09, 2016 3:03 pm 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3096
Location: Cologne, Germany
klivzez wrote:
Is any way to changing this gap?
MigraDoc is Open Source, so there is a way to change it.

But AFAIK the current implementation calculates the position automatically, based on font information.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Thu Jun 09, 2016 3:35 pm 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3096
Location: Cologne, Germany
klivzez wrote:
I prepared mdddl file with my problem.
Thanks.

Lines are at different positions and have different widths.

I'll ask Stefan on Monday about it. Maybe we can fix this with version 1.50 stable.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Mon Jun 13, 2016 1:16 pm 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3096
Location: Cologne, Germany
The reason for the different look: the underlined tab will emit underscore characters ("_"), but for underlined text a line will be drawn.
That's the old implementation and we will not change this for PDFsharp 1.50 stable.

The method "void RenderTabLeader(TabOffset tabOffset)" in class ParagraphRenderer draws the tabulator.
It would be nicer to draw a line with the width and position of underlined text.
Feel free to implement this if you like - and please share your code if you do.
I cannot do it during my working hours - at least not this month.

_________________
Regards
Thomas Hoevel
PDFsharp Team


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

All times are UTC


Who is online

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