PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Tue Mar 19, 2024 2:48 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 9 posts ] 
Author Message
PostPosted: Wed Jan 13, 2010 7:28 pm 
Offline

Joined: Mon Jan 11, 2010 5:35 pm
Posts: 9
AddFormattedText() allows you to format the text as Bold, Italic, NotBold, NotItalic, NoUnderline, Underline.

It would be nice if you could also Strikeout text using this function.

My project requires one of two paragraphs to appear as strikeout text according to the IF...ELSE statement, but I have to draw each line of text using PDFsharp to strikeout. It does not flow as nicely with the rest of document where I use MigraDoc Paragraphs.


Top
 Profile  
Reply with quote  
PostPosted: Thu Jan 14, 2010 9:50 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3092
Location: Cologne, Germany
I put it on the wish list.
Not my area of expertise, but I hope it's easy to implement.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Thu Jan 14, 2010 11:37 pm 
Offline

Joined: Mon Jan 11, 2010 5:35 pm
Posts: 9
Minor thing, but just thought I would pass the word along, thanks! great product!


Top
 Profile  
Reply with quote  
PostPosted: Tue May 10, 2011 2:56 pm 
Offline

Joined: Tue May 10, 2011 2:50 pm
Posts: 4
I had the same issue and resolved it by ussing the underline property and duplicated it.
pdf and rtf render both works now!
here is the path file.


Attachments:
File comment: Strike through path
Strikethrough.zip [3.38 KiB]
Downloaded 1703 times
Top
 Profile  
Reply with quote  
PostPosted: Mon Apr 23, 2012 1:35 pm 
Offline

Joined: Wed May 26, 2010 9:14 am
Posts: 13
Can the patch be made part of the standard product for people like me who don't know how to apply it?


Top
 Profile  
Reply with quote  
PostPosted: Tue Apr 24, 2012 8:25 pm 
Offline

Joined: Tue May 10, 2011 2:50 pm
Posts: 4
i don't know anymore how i made the patch. I do also not have the code with me, because it was from my other employer
but if you can't get it work you can always open it with notpad and read the lines. There will be something about linenumbers and what you should add.

about your PM. How to use the patch.
Same as you use underline, you can now use strikethrough.
the API will normaly add a line under the text if you use underline. The thing i have made was drawing the same line, but a few pixels higher, when you use strikethrough.

hopes it helps you.
otherwise i should start work again with migradoc to explain it in details. However, at the moment i have no project running where i could use migradoc for.


Top
 Profile  
Reply with quote  
PostPosted: Fri May 25, 2018 8:54 am 
Offline

Joined: Tue Aug 15, 2017 11:27 am
Posts: 29
Doomic wrote:

about your PM. How to use the patch.
Same as you use underline, you can now use strikethrough.
the API will normaly add a line under the text if you use underline. The thing i have made was drawing the same line, but a few pixels higher, when you use strikethrough.

Does it work in page preview in WinForms? I apllied patch to Migradoc. Code build fine but i did not see strikethrough in document.
i use this code - paragraph.Format.Font.Striketrough = FontLineStyle.Dotted;


Top
 Profile  
Reply with quote  
PostPosted: Sat Jul 25, 2020 4:50 am 
Offline

Joined: Sat Jul 25, 2020 4:42 am
Posts: 1
Old thread but just in case anyone comes across this as I did, here is a git patch file based on the one above that's valid for commit cb9690cd2ee96ae3609508f551c2765f609e7a5a (1.51.5186 beta) in the github repo.


Attachments:
Strikethrough.zip [5.37 KiB]
Downloaded 670 times
Top
 Profile  
Reply with quote  
PostPosted: Tue Oct 05, 2021 3:10 pm 
Offline

Joined: Tue Oct 05, 2021 3:02 pm
Posts: 1
The patch compiled for me but didn't work. Attached is a much simpler patch I created that works for me. I applied to MigraDoc commit cb9690cd2ee96ae3609508f551c2765f609e7a5a. The patch is simple enough that you could probably manually patch.

Installation:

1. Clone https://github.com/empira/MigraDoc
2. Init PDFSharp Submodule
3. Build All and make sure DLLs are generated
4. Download and unzip patch
5. Put patch in root of migradoc repo
6. git apply 0001-Add-strikethrough.patch
7. Rebuild all
8. Grab DLLs and pull into project that needs strikethrough

Usage:

Code:
font.Underline = Underline.Strikethrough


Attachments:
File comment: Git patch to add strikethrough support
0001-Add-strikethrough.zip [1.67 KiB]
Downloaded 541 times
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC


Who is online

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