In Development
Last Updated: 18 Mar 2024 17:16 by ADMIN

If  row has a property set on it (for example "hidden" or a style), but it does not otherwise have any cells in it, the application might run into an infinite loop. The xml will look like this:

	<sheetData>
		<row r="1" spans="1:2" x14ac:dyDescent="0.35">
			<c r="A1"><v>1</v></c>
			<c r="B1"><v>2</v></c>
		</row>
		<row r="2" spans="1:2" s="1" customFormat="1" x14ac:dyDescent="0.35"/>
	</sheetData>

The last row has formatting applied, so it is present as an element, but has no cells. This file (when the xml is not formatted) will cause an infinite loop on import.

In Development
Last Updated: 15 Mar 2024 16:26 by ADMIN
The text in the footer remains under the image while drawing the PDF content.
In Development
Last Updated: 13 Mar 2024 17:09 by ADMIN

I have the following form:

From the screen shot above you can see that the line above 75 is perfectly ok i.e. it doesn't go and intersect with the lines of the 72

but when i perform the following code


            var InputFileWithInteractiveForms = "C:\\Users\\Abhishek.Shrestha\\Downloads\\Template\\form-ub04.pdf";
            var finaldPDFName = "C:\\Users\\Abhishek.Shrestha\\Downloads\\TestABCPDF\\output2322.pdf";
            List<byte[]> filledupForms = new List<byte[]>();
            PdfFormatProvider provider = new PdfFormatProvider();
                
                RadFixedDocument document = provider.Import(File.ReadAllBytes(InputFileWithInteractiveForms));

                var formfields = document.AcroForm.FormFields;

                var formFieldsCopy = new List<FormField>(document.AcroForm.FormFields);

                // Iterate over the copied form fields and replace the dot character in their names for solving merging issue
                foreach (var field in formFieldsCopy)
                {
                    field.Name = field.Name.Replace(".", "");
                }
                
               //added this as the values were being hidden by editable fields
                document.AcroForm.ViewersShouldRecalculateWidgetAppearances = true;

                filledupForms.Add(provider.Export(document));
                File.WriteAllBytes(finaldPDFName, provider.Export(document));

I get the following output:


               
In Development
Last Updated: 01 Mar 2024 10:57 by ADMIN

The value of the TextBoxField is not visible until the field is clicked.

Workaround: Force content update:

foreach (var widget in textBoxField.Widgets)
{
    widget.RecalculateContent();
}

If the update still doesn't fix the issue, change the font prior to setting the value of the field:

foreach (var widget in textBoxField.Widgets)
{
    widget.TextProperties.Font = FontsRepository.Helvetica;
}
Another option could be to set the ViewersShouldRecalculateWidgetAppearances to true in order to force the viewers to update the appearance of the widgets.
In Development
Last Updated: 01 Mar 2024 10:43 by ADMIN
Import-export causes missing characters with a specific document.
In Development
Last Updated: 29 Feb 2024 15:50 by ADMIN
Created by: Daniel
Comments: 0
Category: Telerik Document Processing
Type: Feature Request
0
The ImageInline class in the WordsProcessing library has a Description available as a property of the Image property. The FloatingImage class also has an Image property but it is internal and its Description property is not available for users of the SpreadProcessing library.
In Development
Last Updated: 13 Feb 2024 12:27 by ADMIN

Styles with names only different in spaces are treated as one.

Workaround:

var rtf = File.ReadAllText(fileName);
rtf = this.RenameStyleDifferentInOnlySpaces(rtf);
var document = provider.Import(rtf);

...

private string RenameStyleDifferentInOnlySpaces(string rtf)
{
    HashSet<string> styles = new HashSet<string>();

    string pattern = @"{\\(?:\*\\c)?s([0-9]+)[^}]*\n?[^}]*\\[^' ]* ?'?([^;]*)";

    var matches = Regex.Matches(rtf, pattern);
    foreach (Match match in matches)
    {
        string styleName = match.Groups[2].Value.Replace(" ", string.Empty);
        if (styles.Contains(styleName))
        {
            styleName = this.ReplaceOldStyleName(ref rtf, styles, match).Replace(" ", string.Empty);
        }

        styles.Add(styleName);
    }

    return rtf;
}

private string ReplaceOldStyleName(ref string rtf, HashSet<string> styles, Match match)
{
    string oldStyleName = match.Groups[2].Value;
    StringBuilder styleNameBuilder = new StringBuilder(oldStyleName + "0");
    while (styles.Contains(styleNameBuilder.ToString().Replace(" ", string.Empty)))
    {
        styleNameBuilder.Append("0");
    }

    string oldMatch = match.Groups[0].Value;
    string newMatch = oldMatch.Replace(oldStyleName, styleNameBuilder.ToString());
    rtf = rtf.Replace(oldMatch, newMatch);
    return styleNameBuilder.ToString();
}

In Development
Last Updated: 07 Feb 2024 13:13 by ADMIN

Handle import of documents with self-referring styles.

As a workaround, you can go through the RTF document structure of a single file and utilize Regex to resolve the self-referring styles like this:

string rtf = File.ReadAllText("inputFile.rtf");
rtf = FixSelfReferringStyles(rtf);

Telerik.Windows.Documents.Flow.FormatProviders.Rtf.RtfFormatProvider provider = new Telerik.Windows.Documents.Flow.FormatProviders.Rtf.RtfFormatProvider(); 

 var document = provider.Import(rtf);

...

private static string FixSelfReferringStyles(string rtf)
{
    string regexString = @"{\\s([0-9]+)[^}]*\\slink([0-9]+)";

    var matches = Regex.Matches(rtf, regexString);
    foreach (Match match in matches)
    {
        if (match.Groups[1].Value == match.Groups[2].Value)
        {
            var oldValue = match.Groups[0].Value;
            var newValue = oldValue.Replace(@" \slink" + match.Groups[1].Value, string.Empty);
            rtf = rtf.Replace(oldValue, newValue);
        }
    }

    return rtf;
}