Free Support Forum - aspose.com

Shrink text on overflow is not working in Aspose.Slides 19.4 version


#1

Hi Team,

I am generating report from template.pptx file by using Aspose.Slides 19.4 version. I am facing issue of text overflow into text box shape. I have selected Shrink text on overflow option for text box shape into template.pptx file. Same code is working properly in Aspose.Slides 18.9 version.
When i open generated report, i am facing issue of text overflow. But when i edit anything into text box shape, automatically effect of shrink text on overflow get affected. I have try to generate same issue in single slide into console application but unable to re-produce it. Can you suggest what could be issue?
I have attached snapshot for your reference.
Text_OverFlow_Issue.png (48.5 KB)


#2

@siriussynoptek,

I have observed the issue shared by you and request you to please share the working sample project along with source presentation and generated presentation. I will be able to investigate the issue further on my end on provision of requested information.


#3

Hi Team,

I have tried to re-produce same issue by creating sample console application but not able to replicate it into sample application. Here is code for same. I have also attached source presentation. Please suggest.
PresentationTemplate.zip (582.2 KB)

class Program
{
static void Main(string[] args)
{
try
{
Presentation MasterTemplate;
Presentation Pres;
ISlideCollection slds;
ISlide PrioritySlide;
string appDirectory = Environment.CurrentDirectory;

            MasterTemplate = new Presentation(appDirectory + "/PresentationTemplate/ServiceOverviewReport_Template.pptx");
            Pres = new Presentation(appDirectory + "/PresentationTemplate/ServiceOverviewReport_Layout.pptx");
            slds = Pres.Slides;

            string PriorityName = "DGP tuehesm ahagghgh and qsqcucnmh";
            //string TermNotes = "helps Account-asdfg marketers asdfedc the proper ayyroach and access the axwswwory ppppa and aspaxilitgts to deliver concrete, specific AAA aaaaaaa plans that target the right audience with the right message to drive desired results. Our approach is shaped by best practices and a deep reservoir of experience with ABC olagging and ecevtgtiod that enables our clients to have confidence in their jhsjhggdh thans.";
            string TermNotes = "Industry ABM account tactic review and selection\nIndustry ABM collaborating with sales\nIndustry ABM contact insights\nIndustry ABM for channel\nIndustry ABM grouped account-to-marketer ratio\nIndustry ABM measurement, refinement and expansion\nIndustry ABM pipeline acceleration\nIndustry ABM measurement, refinement and expansion\nIndustry ABM pipeline acceleration";

            Aspose.Slides.License slideLicense = new Aspose.Slides.License();
            slideLicense.SetLicense(appDirectory + "/PresentationTemplate/Aspose.Total.lic");

            slds.InsertClone(0, MasterTemplate.Slides[0]);
            PrioritySlide = Pres.Slides[0];
            IShape shape;
            shape = FindShape(PrioritySlide, "Description4");
            if (shape != null)
            {                    
                string str = ((IAutoShape)shape).TextFrame.Text;
                if (((IAutoShape)shape).TextFrame.Text != "")
                {
                    if (!string.IsNullOrEmpty(TermNotes))
                    {
                        str = str.Replace("<Description_4>", WebUtility.HtmlDecode(Regex.Replace(TermNotes, "<.*?>", String.Empty)));
                    }
                    else
                    {
                        str = str.Replace("<Description_4>", "");
                    }
                }
                   ((IAutoShape)shape).TextFrame.Text = str;
            }

            shape = FindShape(PrioritySlide, "PriorityTerm4");
            if (shape != null)
            {                   
                string str = ((IAutoShape)shape).TextFrame.Text;
                if (((IAutoShape)shape).TextFrame.Text != "")
                {
                    if (!string.IsNullOrEmpty(PriorityName))
                    {
                        str = str.Replace("<Priority_Term_4>", PriorityName);
                    }
                    else
                    {
                        str = str.Replace("<Priority_Term_4>", "");
                    }
                }
                   ((IAutoShape)shape).TextFrame.Text = str;
            }


            string ReportName = "Demo_Overview_Report.pptx";
            Pres.Save(appDirectory + "/PresentationDownloads/" + ReportName, Aspose.Slides.Export.SaveFormat.Pptx);
        }
        catch (Exception ex)
        {

        }
    }
    
    public static IShape FindShape(ISlide slide, String Name, List<string> shapeindex = null)
    {
        IShape selectedShape = null;
        for (int i = 0; i < slide.Shapes.Count; i++)
        {
            if (shapeindex != null)
            {
                if (shapeindex.Any(s => slide.Shapes[i].Name.Contains(s)))
                {
                    slide.Shapes[i].Hidden = false;

                }
                else if (slide.Shapes[i].Name != "Group 50" && slide.Shapes[i].Name != "Title" && slide.Shapes[i].Name != "Rectangle 44"
                        && slide.Shapes[i].Name != "TextBox 45" && slide.Shapes[i].Name != "Picture 52" && slide.Shapes[i].Name != "Picture 56" && slide.Shapes[i].Name != "Title 2")
                {
                    slide.Shapes[i].Hidden = true;
                }
            }

            if (slide.Shapes[i].Name.CompareTo(Name) == 0)
            {
                if (shapeindex == null)
                { return slide.Shapes[i]; }
                else
                { selectedShape = slide.Shapes[i]; }
            }
        }

        if (selectedShape != null)
        {
            return selectedShape;
        }
        return null;
    }
}

#4

@siriussynoptek,

Thank you for sharing the information. I have worked with the sample project shared by you and have been able to reproduce the issue. An issue with ID SLIDESNET-41120 has been created in our issue tracking system to further investigate and resolve the issue. This thread has been linked with issue so that you may be notified once issue will be fixed.