PDFsharp & MigraDoc Foundation
https://forum.pdfsharp.net/

Strikeout MigraDoc Text with AddFormattedText()
https://forum.pdfsharp.net/viewtopic.php?f=4&t=1021
Page 1 of 1

Author:  jro280 [ Wed Jan 13, 2010 7:28 pm ]
Post subject:  Strikeout MigraDoc Text with AddFormattedText()

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.

Author:  Thomas Hoevel [ Thu Jan 14, 2010 9:50 am ]
Post subject:  Re: Strikeout MigraDoc Text with AddFormattedText()

I put it on the wish list.
Not my area of expertise, but I hope it's easy to implement.

Author:  jro280 [ Thu Jan 14, 2010 11:37 pm ]
Post subject:  Re: Strikeout MigraDoc Text with AddFormattedText()

Minor thing, but just thought I would pass the word along, thanks! great product!

Author:  Doomic [ Tue May 10, 2011 2:56 pm ]
Post subject:  Re: Strikeout MigraDoc Text with AddFormattedText()

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 1726 times

Author:  DaveR [ Mon Apr 23, 2012 1:35 pm ]
Post subject:  Re: Strikeout MigraDoc Text with AddFormattedText()

Can the patch be made part of the standard product for people like me who don't know how to apply it?

Author:  Doomic [ Tue Apr 24, 2012 8:25 pm ]
Post subject:  Re: Strikeout MigraDoc Text with AddFormattedText()

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.

Author:  pistoletov [ Fri May 25, 2018 8:54 am ]
Post subject:  Re: Strikeout MigraDoc Text with AddFormattedText()

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;

Author:  sandocdo [ Sat Jul 25, 2020 4:50 am ]
Post subject:  Re: Strikeout MigraDoc Text with AddFormattedText()

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 682 times

Author:  rpgillespie [ Tue Oct 05, 2021 3:10 pm ]
Post subject:  Re: Strikeout MigraDoc Text with AddFormattedText()

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 558 times

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/