Completed
Last Updated: 12 Apr 2021 08:55 by ADMIN
Release R2 2021
David
Created on: 08 Apr 2021 04:58
Category: WordsProcessing
Type: Bug Report
0
WordsProcessing: PdfFormatProvider: Wrongly exported Hyperlink field

The Hyperlink field is wrongly exported when the Code fragment is divided into several text fragments.

Actual:

Expected:

Workaround: Iterate the document content after importing it into RadFlowDocument in order to modify the Code fragment:

bool isBetweenStartAndSeparation = false;
string fieldInfoText = string.Empty;
int startIndex = 0;
IEnumerable<Paragraph> paragraphs = document.EnumerateChildrenOfType<Paragraph>();
foreach (Paragraph paragraph in paragraphs)
{
	foreach (InlineBase inline in paragraph.Inlines.ToList())
	{
		if (inline is FieldCharacter)
		{
			FieldCharacter fieldCharacter = inline as FieldCharacter;
			if (fieldCharacter.FieldCharacterType == FieldCharacterType.Separator)
			{
				isBetweenStartAndSeparation = false;
				Run run = new Run(this.document)
				{
					Text = fieldInfoText
				};

				paragraph.Inlines.Insert(startIndex, run);
			}
			else if (fieldCharacter.FieldCharacterType == FieldCharacterType.Start)
			{
				isBetweenStartAndSeparation = true;
				startIndex = paragraph.Inlines.IndexOf(inline) + 1;
				fieldInfoText = fieldCharacter.FieldInfo.GetCode().Trim().ToLowerInvariant();
			}
		}
		else if (isBetweenStartAndSeparation)
		{
			paragraph.Inlines.Remove(inline);
		}
	}
}

1 comment
ADMIN
Peshito
Posted on: 12 Apr 2021 08:55

Hello,

This item will be available in R2 2021 Release. 

It is also available with Telerik UI for WPF's latest internal build - LIB 2021.1.412 (12/04/2021) if you need it earlier. 

Regards,
Peshito
Progress Telerik

Тhe web is about to get a bit better! 

The Progress Hack-For-Good Challenge has started. Learn how to enter and make the web a worthier place: https://progress-worthyweb.devpost.com.