Невозможно установить поле ячейки таблицы, используя ASPOSE Slides - PullRequest
1 голос
/ 07 мая 2019

Я добавил таблицу на слайде, и внутри таблицы я добавил несколько строк с некоторым текстом.Проблема, с которой я сталкиваюсь, заключается в том, что я не могу уменьшить расстояние / поля между ячейками.Я могу установить свойство top margin-bottom margin после открытия ppt, и оно отлично работает, чтобы уменьшить пространство между ячейками.Но то же самое не достижимо с помощью кода.Ниже приведен пример кода, над которым я работаю.Прикрепленный скриншот раздела таблицы ppt, который я получаю. Токовый выход

            ISlide sld = press.Slides[0];
            // Define columns with widths and rows with heights
            double[] dblC = { 300, 300 };
            double[] dblR = { 70, 70, 70 };

            ITable tblH = sld.Shapes.AddTable(100, 82, dblC, dblR);
            tblH.FirstRow = false;
            tblH.Rows[0].MinimalHeight = 0;
            tblH.Rows[1].MinimalHeight = 0;
            tblH.Rows[2].MinimalHeight = 0;

            ITextFrame txtFrame = tblH[0, 0].TextFrame;
            txtFrame.TextFrameFormat.MarginBottom = 50f;
            IParagraph paragraph = txtFrame.Paragraphs[0];
            IPortion portion = paragraph.Portions[0];
            portion.PortionFormat.LatinFont = new FontData("Arial");
            portion.PortionFormat.FontBold = NullableBool.True;
            portion.Text = "Some Text";
            portion.PortionFormat.FillFormat.FillType = FillType.Solid;
            portion.PortionFormat.FillFormat.SolidFillColor.Color = Color.Black;
            portion.PortionFormat.FontHeight = 8;

            ITextFrame txtFrame1 = tblH[0, 1].TextFrame;
            txtFrame1.TextFrameFormat.MarginTop = 30f;
            IParagraph paragraph1 = txtFrame1.Paragraphs[0];
            IPortion portion1 = paragraph1.Portions[0];
            portion1.PortionFormat.LatinFont = new FontData("Arial");
            portion1.PortionFormat.FontBold = NullableBool.True;
            portion1.Text = "Some Text";
            txtFrame1.TextFrameFormat.ColumnSpacing = 5f;
            portion1.PortionFormat.FillFormat.FillType = FillType.Solid;
            portion1.PortionFormat.FillFormat.SolidFillColor.Color = Color.Black;
            portion1.PortionFormat.FontHeight = 6;

            ITextFrame txtFrame2 = tblH[0, 2].TextFrame;
            txtFrame2.TextFrameFormat.MarginTop = 30f;
            IParagraph paragraph2 = txtFrame2.Paragraphs[0];
            IPortion portion2 = paragraph2.Portions[0];
            portion2.PortionFormat.LatinFont = new FontData("Arial");
            portion2.PortionFormat.FontBold = NullableBool.True;
            portion2.Text = "Some Text";
            portion2.PortionFormat.FillFormat.FillType = FillType.Solid;
            portion2.PortionFormat.FillFormat.SolidFillColor.Color = Color.Black;
            portion2.PortionFormat.FontHeight = 5;

желаемым выходом будет то, что промежутки между ячейками должны быть уменьшены.Пожалуйста, предложите.

1 Ответ

2 голосов
/ 07 мая 2019

@ Панкай

Можете ли вы поделиться желаемым выходным файлом презентации, который вы хотите сгенерировать, используя Aspose.Slides. Я изучу ваши требования и смогу в дальнейшем помочь вам в предоставлении запрошенной информации.

Я также наблюдал ваш пример кода и в том, что вы используете поля TextFrame. Я хотел бы добавить, что когда вы работаете с ячейками таблицы, вам нужно установить поле для ячейки таблицы напрямую. Я предлагаю вам рассмотреть следующие изменения в вашем коде, чтобы наблюдать за изменениями.

        tblH[0, 0].MarginBottom=50f;

Я работаю разработчиком поддержки / евангелистом в Aspose.

...