The Syncfusion® native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
Could you help me with code to 'flatten' hyperlinks?
I need to replace all hyperlinks in a document with regular text while keeping the hyperlink style, so it looks like a hyperlink but has no functionality
SRSindhu Ramesh Syncfusion Team March 3, 2025 04:50 PM UTC
Hi Branislav,
Based on the details provided, we understand that your requirement is to
replace all hyperlinks in a document with regular text while retaining the
hyperlink style. To achieve this, we have prepared a sample. Kindly refer
to the working sample along with the input and output documents.
In this sample, we have done the following things: 1. Open DOCX document. 2. Find all hyperlinks using FindAllItemsByProperty() 3. Iterate through all hyperlinks. 4. Create text range with TextToDisplay
of the hyperlink. 5. Apply hyperlink style to the text
range. 6. Remove the hyperlink from the
document and insert the formatted text range at the same index. 7. Save modified DOCX document.
If your requirement is different, kindly share the input and expected output
documents. This will help us provide a solution at the earliest.