ISvgShapeAndTextFormattingController

All Implemented Interfaces: com.aspose.slides.ISvgShapeFormattingController

public interface ISvgShapeAndTextFormattingController extends ISvgShapeFormattingController

Controls SVG shape and text generation.


Example:
 
 class CustomSvgShapeFormattingController implements ISvgShapeAndTextFormattingController
 {
     private int m_shapeIndex, m_portionIndex, m_tspanIndex;

     public CustomSvgShapeFormattingController(int shapeStartIndex)
     {
         m_shapeIndex = shapeStartIndex;
         m_portionIndex = 0;
     }
     public void formatShape(ISvgShape svgShape, IShape shape)
     {
         svgShape.setId(String.format("shape-%d", m_shapeIndex++));
         m_portionIndex = m_tspanIndex = 0;
     }
     public void formatText(ISvgTSpan svgTSpan, IPortion portion, ITextFrame textFrame)
     {
         int paragraphIndex = 0; int portionIndex = 0;
         for (int i = 0; i < textFrame.getParagraphs().getCount(); i++)
         {
             portionIndex = textFrame.getParagraphs().get_Item(i).getPortions().indexOf(portion);
             if (portionIndex > -1) { paragraphIndex = i; break; }
         }
         if (m_portionIndex != portionIndex)
         {
             m_tspanIndex = 0;
             m_portionIndex = portionIndex;
         }
         svgTSpan.setId(String.format("paragraph-%d_portion-%d_%d", paragraphIndex, m_portionIndex, m_tspanIndex++));
     }
 }

Methods

Method Description
formatText(ISvgTSpan svgTSpan, IPortion portion, ITextFrame textFrame) This function is called before rendering of text portion to SVG to allow user to control resulting SVG.

formatText(ISvgTSpan svgTSpan, IPortion portion, ITextFrame textFrame)

public abstract void formatText(ISvgTSpan svgTSpan, IPortion portion, ITextFrame textFrame)

This function is called before rendering of text portion to SVG to allow user to control resulting SVG.

Parameters:

Parameter Type Description
svgTSpan ISvgTSpan Object to control SVG tspan generation.
portion IPortion Source portion.
textFrame ITextFrame Source portion text frame.