Unplanned
Last Updated: 03 May 2022 08:35 by Peg
Peg
Created on: 03 May 2022 08:35
Category: WordsProcessing
Type: Bug Report
1
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