Completed
Last Updated: 02 Aug 2024 11:09 by ADMIN
Release 2024.3.802 (2024 Q3)
Peg
Created on: 03 May 2022 08:35
Category: WordsProcessing
Type: Bug Report
2
WordsProcessing: Hanging indent is not respected when exporting paragraph with tabs to PDF

The hanging indent of the paragraph affects the rendering of content with tabs. However, the indent is not respected while generating the PDF, leading to disordered content.

Workaround: Insert a tab stop with the position set to the value for hanging indent:

foreach (var paragraph in this.flowDocument.EnumerateChildrenOfType<Paragraph>())
{
    if (paragraph.Properties.HangingIndent.HasLocalValue)
    {
        Run run = paragraph.EnumerateChildrenOfType<Run>().Where(r => r.Text == "\t").FirstOrDefault();

        if (run != null)
        {
            paragraph.TabStops = paragraph.TabStops.Insert(new Telerik.Windows.Documents.Flow.Model.Styles.TabStop(paragraph.Properties.HangingIndent.LocalValue.Value));
        }

    }
}

0 comments