Browse our Products

Aspose.Slides for Java 20.2 Release Notes

KeySummaryCategory
SLIDESNET-41674Extremely slow PPT to PDF ConversionEnhancement
SLIDESNET-40977Support for getting size of paragaph and portion inside table cell text frameFeature
SLIDESNET-36546Update custom document properties directly on the source documentFeature
SLIDESJAVA-38029PPT to PDF Index of connection site must be less than StartShapeConnectedTo.ConnectionSiteCountBug
SLIDESJAVA-38023Application hangs when converting a PPTX to PDFBug
SLIDESJAVA-38024PptxReadException on loading the fileBug
SLIDESJAVA-38032PPT to PDF Specified argument was out of the range of valid valuesBug
SLIDESJAVA-37999ODP not properly converted to PDFBug
SLIDESJAVA-38025The conversion to PDF lasts too long and causes OOM exceptionBug
SLIDESJAVA-37757Out of Memory exception when saving pptBug
SLIDESJAVA-35585Text placed on wrong positionBug
SLIDESJAVA-38026OutOfMemoryError on AWS lambdaBug
SLIDESJAVA-38027Font style substitutionBug
SLIDESJAVA-38030PPTX to PDF PptxReadException: 0Bug
SLIDESJAVA-38031PPT to PDF Requested a name string that is not present in the fontBug
SLIDESJAVA-38033PPT to PDF rectangle cannot have width or height equal to 0Bug
SLIDESJAVA-38035PPT to PDF java.lang.StackOverflowErrorBug
SLIDESJAVA-38036PPT to PDF java.lang.NullReferenceExceptionBug
SLIDESJAVA-38037PPT to PDF PptxReadExceptionBug
SLIDESJAVA-38038PPT to PDF java.lang.NullPointerExceptionBug
SLIDESJAVA-37388Thumbnails not properly generatedBug
SLIDESJAVA-37752Slides To PDF in AWS LambdaImage is missing
SLIDESJAVA-38040PPT to PDF PptxReadExceptionBug
SLIDESJAVA-34394Wrong layout slide is selected for source and cloned slides in Aspsoe.Slides generated PPTBug

Public API Changes


Get Text Location in a Table Cell

Method IPortion.getRect() has been added. This method extends and actually replaces method IPortion.getCoordinates() which is marked as obsolete now. Methods IPortion.getRect() and IParagraph.getRect() can be applied to text within table cells.

The following example shows how those properties work. Let’s say we have a table with some text inside and simple AutoShape nearby.

todo:image_alt_text

The code snippet below generates those objects.

Presentation pres = new Presentation();
try
{
    ITable tbl = pres.getSlides().get_Item(0).getShapes().addTable(50, 50, new double[] { 50, 70 }, new double[] { 50, 50, 50 });

    IParagraph paragraph0 = new Paragraph();
    paragraph0.getPortions().add(new Portion("Text "));
    paragraph0.getPortions().add(new Portion("in0"));
    paragraph0.getPortions().add(new Portion(" Cell"));

    IParagraph paragraph1 = new Paragraph();
    paragraph1.setText("On0");

    IParagraph paragraph2 = new Paragraph();
    paragraph2.getPortions().add(new Portion("Hi there "));
    paragraph2.getPortions().add(new Portion("col0"));

    ICell cell = tbl.get_Item(1, 1);
    cell.getTextFrame().getParagraphs().clear();
    cell.getTextFrame().getParagraphs().add(paragraph0);
    cell.getTextFrame().getParagraphs().add(paragraph1);
    cell.getTextFrame().getParagraphs().add(paragraph2);

    IAutoShape autoShape = pres.getSlides().get_Item(0).getShapes().addAutoShape(ShapeType.Rectangle, 400, 100, 60, 120);
    autoShape.getTextFrame().setText("Text in shape");
} finally {
    if (pres != null) pres.dispose();
}

The source code snippet below will add a yellow frame to all paragraphs and blue frame to all portions which contain substring “0”.

  1. In the first step, We’re getting coordinates of the left top corner of the table cell.
double x = tbl.getX() + cell.getOffsetX();
double y = tbl.getY() + cell.getOffsetY();
  1. In the next step we’re using IParagrap.getRect() and IPortion.getRect() methods in order to add frame to portions and paragraphs.
for (IParagraph para : cell.getTextFrame().getParagraphs())
{
    if (para.getText().equals(""))
        continue;
    Rectangle2D.Float rect = para.getRect();
    IAutoShape shape =
            pres.getSlides().get_Item(0).getShapes().addAutoShape(ShapeType.Rectangle,
                    rect.getX() + (float)x, rect.getY)( + (float)y, rect.getWidth(), rect.getHeight());
    shape.getFillFormat().setFillType(FillType.NoFill);
    shape.getLineFormat().getFillFormat().getSolidFillColor().setColor(Color.YELLOW);
    shape.getLineFormat().getFillFormat().setFillType(FillType.Solid);

    for (IPortion portion : para.getPortions())
    {
        if (portion.getText().contains("0"))
        {
            rect = portion.getRect();
            shape =
                    pres.getSlides().get_Item(0).getShapes().addAutoShape(ShapeType.Rectangle,
                            rect.getX() + (float)x, rect.getY() + (float)y, rect.getWidth(), rect.getHeight());
            shape.getFillFormat().setFillType(FillType.NoFill);
        }
    }
}
  1. Add frame to AutoShape paragraphs.
for (IParagraph para : autoShape.getTextFrame().getParagraphs())
{
    Rectangle2D.Float rect = para.getRect();
    IAutoShape shape =
            pres.getSlides().get_Item(0).getShapes().addAutoShape(ShapeType.Rectangle, 
                    (float) (rect.getX() + autoShape.getX()), (float) (rect.getY() + autoShape.getY()), (float) rect.getWidth(), (float) rect.getHeight());
    shape.getFillFormat().setFillType(FillType.NoFill);
    shape.getLineFormat().getFillFormat().getSolidFillColor().setColor(Color.YELLOW);
    shape.getLineFormat().getFillFormat().setFillType(FillType.Solid);
}

Result:

todo:image_alt_text