You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I found there is a Bug in ShapeCrawler.
I cannot the attribute isBold, LatinName and OffsetEffect of the Text in a Table Cell.
For example, in the code below.
using System;
using System.IO;
using ShapeCrawler;
class Program
{
static void Main(string[] args)
{
// Create a new PPT and gets its First Slide
var pres = new Presentation();
ISlide slide = pres.Slides[0];
// Create a Table and get the Table
slide.Shapes.AddTable(40, 40, 6, 5);
var table = (ITable)slide.Shapes.Last();
// Add text into a Table Cell
var cell = table[1, 2];
cell.TextFrame.Text = "Hello";
// Edit the Text Font in the Table Cell
var cellFont = cell.TextFrame.Paragraphs.First().Portions.First().Font;
cellFont.Size = 40;
cellFont.LatinName = "Prelo Slab Bold";
// Get the Path of Desktop
string desktopPath = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
// Assgin the complete Path to save PPT File
string pptFilePath = Path.Combine(desktopPath, "Text1.pptx");
pres.SaveAs(pptFilePath);
Console.WriteLine($"PPT has been saved to:{pptFilePath}");
}
}
I created a Table and get the Table Cell in Row 2, Column 3.
I added a Text Hello in that Table Cell.
I can only change the Font Size of Hello.
However, if I try to change the Font's LatinName,
it will always throws an Exception in Line 24,
which states Sequence contains no Element
I used BreakPoint to debug, I found that Exception will occur in the three attributes of Font:
isBold
LatinName
OffsetEffect
The Exception is located at System.Linq.Enumerable.First[TSource].
Therefore, I am sure that the Original Code of ShapeCrawler has some bugs
It cannot change the isBold, LatinName and OffsetEffect of the Text in a Table Cell.
The text was updated successfully, but these errors were encountered:
Hello, I found there is a Bug in ShapeCrawler.
I cannot the attribute isBold, LatinName and OffsetEffect of the Text in a Table Cell.
For example, in the code below.
I created a Table and get the Table Cell in Row 2, Column 3.
I added a Text
Hello
in that Table Cell.I can only change the Font Size of
Hello
.However, if I try to change the Font's LatinName,
it will always throws an Exception in Line 24,
which states
Sequence contains no Element
I used BreakPoint to debug, I found that Exception will occur in the three attributes of Font:
The Exception is located at System.Linq.Enumerable.First[TSource].
Therefore, I am sure that the Original Code of ShapeCrawler has some bugs
It cannot change the isBold, LatinName and OffsetEffect of the Text in a Table Cell.
The text was updated successfully, but these errors were encountered: