Free Support Forum - aspose.com

How to get the number of portions distributed inside a column of a text frame (Java)

Hi Team
I hope you are doing well. Happy new year to all.
Recently I try to get the number of portions added in the one column using the (JAVA) aspose-slides 19.3 jdk16.

  public Presentation produce(Presentation presentation, JSONArray sources) {

	// pptxAutoShape - is the shape in which I want to add the text.
        ITextFrame iTextFrame = pptxAutoShape.getTextFrame();
        iTextFrame.getTextFrameFormat().setAnchoringType(TextAnchorType.Top);
        iTextFrame.getTextFrameFormat().setAutofitType(TextAutofitType.Normal);
        IParagraph[] paragraph = new Paragraph[sources.length()];

        iTextFrame.getParagraphs().removeAt(0);
        ITextFrameFormat format = pptxAutoShape.getTextFrame().getTextFrameFormat();
        format.setColumnCount(3); // Specify number of columns in TextFrame
        format.setColumnSpacing(10); // Specify spacing between columns

        for(int j = 0; j < sources.length(); j++) {
            JSONObject slideInfo = sources.getJSONObject(j);
            paragraph[j] = new Paragraph();
            IPortion port = new Portion();
								
		port.setText(slideInfo.getString("slideTitle"));
        	port.getPortionFormat().setFontHeight(10);
        				
		paragraph[j].getParagraphFormat().setSpaceBefore(50.0F);								
		paragraph[j].getParagraphFormat().setSpaceAfter(30.0F);
        	paragraph[j].getParagraphFormat().setIndent(10);
               
            Hyperlink hyperlink = new Hyperlink(presentation.getSlides().get_Item(order));
        	hyperlink.setTooltip(slideInfo.getString("slideTitle"));
        	port.getPortionFormat().setHyperlinkClick(hyperlink);

            paragraph[j].getPortions().add(port);
             iTextFrame.getParagraphs().add(paragraph[j]);
        }
        return presentation;
    }

using the above code I can add the multiple hyperlinks in the same shape. Can you please help me to know that is it possible to know the limit of the portion how much I can add in one column and how to get the number of the portion added in one specific column.
Required to know the count of portions in one column so that when there is only one link in any column then I have to move two more links from the previous column.

Thanks for help & support in advance.

@Shree995,

I have observed your requirements and regret to share that when you add column or columns inside text frame the text belonging to even a single portion can span across multiple columns (depending on size of text frame). Therefore, there is no mechanism on back end that portions of text are distributed in columns. However, I have still created an issue with ID SLIDESJAVA-38015 in our issue tracking system to investigate the possibility of implementing requested support. This thread has been linked with the issue so that you may be notified once the response will be available.

@mudassir.fayyaz Thanks for the clarification.

@Shree995,

You are always welcome. Please share, if I may be of any further help to you in this regard.