Shapes 接口描述

 

操作PowerPoint中的形状,包括获取、创建、删除形状和段落,设置形状和段落的属性,将形状导出为指定的图片格式等。

接口方法1:getSlideShapes()获取幻灯片中的形状信息

HTTP 请求方法:GET

请求URL:https://api.e-iceblue.cn/v1/powerpoint/{name}/slides/{slideIndex}/shapes

请求参数:

参数 是否必选 类型 可选值范围 说明
name string   原文档名称
sildeIndex integer   幻灯片索引
folder string   存放原文档的文件夹,没有则为null
storage string   文档存储空间,使用冰蓝云配置的2G空间存贮文档,可设置为null
password string   原文档密码,没有则为null

Java代码示例:

import spire.cloud.powerpoint.sdk.*;
import spire.cloud.powerpoint.sdk.api.ShapesApi;
import spire.cloud.powerpoint.sdk.model.*;

public class getSlideShapes {
    static String appId = "your id";
    static String appKey = "your key";
    static String baseUrl = "https://api.e-iceblue.cn";
    static Configuration configuration = new Configuration(appId, appKey, baseUrl);
    static ShapesApi shapesApi = new ShapesApi(configuration);

    public static void main(String[] args) throws ApiException {
        String name = "getSlideShapes.pptx";
        Integer slideIndex = 0;
        String password = null;
        String storage = null;
        String folder = "input";
        Shapes response = shapesApi.getSlideShapes(name, slideIndex, password, folder, storage);
    }
}

接口方法2:addNewShape()创建新的形状

HTTP 请求方法:POST

请求URL:https://api.e-iceblue.cn/v1/powerpoint/{name}/slides/{slideIndex}/shapes

请求参数:

参数 是否必选 类型 可选值范围 说明
name string   原文档名称
sildeIndex integer   幻灯片索引
source object { "SelfUri": { "Href": "string", "Relation": "string", "LinkType": "string", "Title": "string" }, "AlternateLinks": [ { "Href": "string", "Relation": "string", "LinkType": "string", "Title": "string" } ], "Name": "string", "Width": 0, "Height": 0, "AlternativeText": "string", "AlternativeTextTitle": "string", "Hidden": true, "X": 0, "Y": 0, "ZOrderPosition": 0, "Shapes": [ { "Uri": { "Href": "string", "Relation": "string", "LinkType": "string", "Title": "string" } } ], "FillFormat": {}, "EffectFormat": { "Blur": { "Radius": 0, "Grow": true }, "Glow": { "Radius": 0, "Color": "string" }, "InnerShadow": { "Direction": 0, "Distance": 0, "BlurRadius": 0, "ShadowColor": "string" }, "OuterShadow": { "Direction": 0, "Distance": 0, "BlurRadius": 0, "ShadowColor": "string" }, "PresetShadow": { "Direction": 0, "Distance": 0, "Preset": "TopLeftDrop", "ShadowColor": "string" }, "SoftEdge": { "Radius": 0 }, "Reflection": { "Direction": 0, "FadeDirection": 0, "Distance": 0, "BlurRadius": 0, "ScaleHorizontal": 0, "ScaleVertical": 0, "SkewHorizontal": 0, "SkewVertical": 0, "StartPosAlpha": 0, "EndPosAlpha": 0, "StartReflectionOpacity": 0, "EndReflectionOpacity": 0, "RectangleAlign": "None", "RotateShadowWithShape": true }, "FillOverlay": { "Blend": "Darken" } }, "LineFormat": { "Alignment": "None", "CapStyle": "None", "DashStyle": "None", "JoinStyle": "None", "Style": "None", "BeginArrowHead": { "Length": "None", "Style": "UnDefined", "Width": "None" }, "EndArrowHead": { "Length": "None", "Style": "UnDefined", "Width": "None" }, "CustomDashPattern": { "Items": [ 0 ] }, "FillFormat": {}, "MiterLimit": 0, "Width": 0 }, "ShapeType": "Custom" } 形状的数据传输对象
folder string   存放原文档的文件夹,没有则为null
storage string   文档存储空间,使用冰蓝云配置的2G空间存贮文档,可设置为null
password string   原文档密码,没有则为null
shapeToClone integer   不添加新的形状,而是复制索引处的形状
position integer   新形状在集合中的位置。默认是在集合的末尾

Java代码示例:

import spire.cloud.powerpoint.sdk.*;
import spire.cloud.powerpoint.sdk.api.ShapesApi;
import spire.cloud.powerpoint.sdk.model.*;

public class addNewShape {
    static String appId = "your id";
    static String appKey = "your key";
    static String baseUrl = "https://api.e-iceblue.cn";
    static Configuration configuration = new Configuration(appId, appKey, baseUrl);
    static ShapesApi shapesApi = new ShapesApi(configuration);

    public static void main(String[] args) throws ApiException {
        String name = "addNewShape.pptx";
        Integer  slideIndex = 0;
        String password = null;
        String storage = null;
        String folder = "input";
        ShapeBase source = new ShapeBase();
        source.setName("ShapeName");
        source.setShapeType(ShapeTypeEnum.BEVEL.toString());
        source.setX(50d);
        source.setY(50d);
        source.setHeight(100d);
        source.setWidth(200d);
        source.setAlternativeText( "AlternativeText");
        source.setAlternativeTextTitle("AlternativeTextTitle");
        source.setHidden( false);
        //picture
        String fileName = "input/image.jpg";
        ResourceUriElement image = new ResourceUriElement();
        ResourceUri url = new ResourceUri();
        url.setHref(fileName);
        url.setRelation(null);
        url.setLinkType(null);
        url.setTitle(null);
        image.setUri(url);
        PictureFill pictureFill = new PictureFill();
        pictureFill.setCropBottom(2d);
        pictureFill.setCropLeft(5d);
        pictureFill.setCropRight(2d);
        pictureFill.setCropTop(5d);
        pictureFill.setDpi(96);
        pictureFill.setImage(image);
        pictureFill.setBase64Data(null);
        pictureFill.setSvgData(null);
        pictureFill.setPictureFillMode("Tile");
        source.setFillFormat(pictureFill);
        source.setZorderPosition(0);
        source.setType("ShapeBase");

        ArrowHeadProperties begainArrowHead = new ArrowHeadProperties();
        begainArrowHead.setLength("Short");
        begainArrowHead.setStyle("TriangleArrowHead");
        begainArrowHead.setWidth("Narrow");
        ArrowHeadProperties endArrowHead = new ArrowHeadProperties();
        endArrowHead.setLength("Short");
        endArrowHead.setStyle("TriangleArrowHead");
        endArrowHead.setWidth("Narrow");
        LineFormat lineFormat = new LineFormat();
        lineFormat.setAlignment("Center");
        lineFormat.setCapStyle("Round");
        lineFormat.setDashStyle("Dot");
        lineFormat.joinStyle("Bevel");
        lineFormat.style("ThinThin");
        lineFormat.beginArrowHead(begainArrowHead);
        lineFormat.endArrowHead(endArrowHead);
        lineFormat.setCustomDashPattern(null);
        SolidFill solidFill = new SolidFill("red");
        lineFormat.setFillFormat(solidFill);
        lineFormat.setMiterLimit(1d);
        lineFormat.setWidth(4d);
        source.setLineFormat(lineFormat);
        Integer shapeToClone = null;
        Integer position = null;
        ShapeBase response = shapesApi.addNewShape(name, slideIndex, source, password, folder, storage, shapeToClone, position);
    }
}

接口方法3:deleteSlideShapes()删除形状

HTTP 请求方法:DELETE

请求URL:https://api.e-iceblue.cn/v1/powerpoint/{name}/slides/{slideIndex}/shapes

请求参数:

参数 是否必选 类型 可选值范围 说明
name string   原文档名称
slideIndex integer   幻灯片索引
shapes string   要删除的形状的索引,默认删除所有形状
folder string   存放原文档的文件夹,没有则为null
storage string   文档存储空间,使用冰蓝云配置的2G空间存贮文档,可设置为null
password string   原文档密码,没有则为null

Java代码示例:

import spire.cloud.powerpoint.sdk.*;
import spire.cloud.powerpoint.sdk.api.ShapesApi;
import spire.cloud.powerpoint.sdk.model.*;

public class deleteSlideShapes {
    static String appId = "your id";
    static String appKey = "your key";
    static String baseUrl = "https://api.e-iceblue.cn";
    static Configuration configuration = new Configuration(appId, appKey, baseUrl);
    static ShapesApi shapesApi = new ShapesApi(configuration);

    public static void main(String[] args) throws ApiException {
        String name = "deleteSlideShapes.pptx";
        Integer  slideIndex = 0;
        String shapes = "[0,1]";
        String password = null;
        String storage = null;
        String folder = "input";
        Shapes response = shapesApi.deleteSlideShapes(name, slideIndex, shapes, password, folder, storage);
    }
}

接口方法4:getSlideShape()获取幻灯片中的形状信息

HTTP 请求方法:GET

请求URL:https://api.e-iceblue.cn/v1/powerpoint/{name}/slides/{slideIndex}/shapes/{shapeIndex}

请求参数:

参数 是否必选 类型 可选值范围 说明
name string   原文档名称
slideIndex integer   幻灯片索引
shapeIndex string   形状或形状组的索引
folder string   存放原文档的文件夹,没有则为null
storage string   文档存储空间,使用冰蓝云配置的2G空间存贮文档,可设置为null
password string   原文档密码,没有则为null

Java代码示例:

import spire.cloud.powerpoint.sdk.*;
import spire.cloud.powerpoint.sdk.api.ShapesApi;
import spire.cloud.powerpoint.sdk.model.*;

public class getSlideShape {
    static String appId = "your id";
    static String appKey = "your key";
    static String baseUrl = "https://api.e-iceblue.cn";
    static Configuration configuration = new Configuration(appId, appKey, baseUrl);
    static ShapesApi shapesApi = new ShapesApi(configuration);

    public static void main(String[] args) throws ApiException {
        String name = "getSlideShape.pptx";
        Integer  slideIndex = 0;
        String shapeIndex = "0";
        String password = null;
        String storage = null;
        String folder = "input";
        ShapeBase response = shapesApi.getSlideShape(name, slideIndex, shapeIndex, password, folder, storage);
    }
}

接口方法5:setSlideShapeInfo()设置形状的属性

HTTP 请求方法:PUT

请求URL:https://api.e-iceblue.cn/v1/powerpoint/{name}/slides/{slideIndex}/shapes/{shapeIndex}

请求参数:

参数 是否必选 类型 可选值范围 说明
name string   原文档名称
slideIndex integer   幻灯片索引
shapeIndex string   形状索引或形状组的索引
source object { "SelfUri": { "Href": "string", "Relation": "string", "LinkType": "string", "Title": "string" }, "AlternateLinks": [ { "Href": "string", "Relation": "string", "LinkType": "string", "Title": "string" } ], "Name": "string", "Width": 0, "Height": 0, "AlternativeText": "string", "AlternativeTextTitle": "string", "Hidden": true, "X": 0, "Y": 0, "ZOrderPosition": 0, "Shapes": [ { "Uri": { "Href": "string", "Relation": "string", "LinkType": "string", "Title": "string" } } ], "FillFormat": {}, "EffectFormat": { "Blur": { "Radius": 0, "Grow": true }, "Glow": { "Radius": 0, "Color": "string" }, "InnerShadow": { "Direction": 0, "Distance": 0, "BlurRadius": 0, "ShadowColor": "string" }, "OuterShadow": { "Direction": 0, "Distance": 0, "BlurRadius": 0, "ShadowColor": "string" }, "PresetShadow": { "Direction": 0, "Distance": 0, "Preset": "TopLeftDrop", "ShadowColor": "string" }, "SoftEdge": { "Radius": 0 }, "Reflection": { "Direction": 0, "FadeDirection": 0, "Distance": 0, "BlurRadius": 0, "ScaleHorizontal": 0, "ScaleVertical": 0, "SkewHorizontal": 0, "SkewVertical": 0, "StartPosAlpha": 0, "EndPosAlpha": 0, "StartReflectionOpacity": 0, "EndReflectionOpacity": 0, "RectangleAlign": "None", "RotateShadowWithShape": true }, "FillOverlay": { "Blend": "Darken" } }, "LineFormat": { "Alignment": "None", "CapStyle": "None", "DashStyle": "None", "JoinStyle": "None", "Style": "None", "BeginArrowHead": { "Length": "None", "Style": "UnDefined", "Width": "None" }, "EndArrowHead": { "Length": "None", "Style": "UnDefined", "Width": "None" }, "CustomDashPattern": { "Items": [ 0 ] }, "FillFormat": {}, "MiterLimit": 0, "Width": 0 }, "ShapeType": "Custom" } 形状的数据传输对象
folder string   存放原文档的文件夹,没有则为null
storage string   文档存储空间,使用冰蓝云配置的2G空间存贮文档,可设置为null
password string   原文档密码,没有则为null

Java代码示例:

import spire.cloud.powerpoint.sdk.*;
import spire.cloud.powerpoint.sdk.api.ShapesApi;
import spire.cloud.powerpoint.sdk.model.*;

public class setSlideShapeInfo {
    static String appId = "your id";
    static String appKey = "your key";
    static String baseUrl = "https://api.e-iceblue.cn";
    static Configuration configuration = new Configuration(appId, appKey, baseUrl);
    static ShapesApi shapesApi = new ShapesApi(configuration);

    public static void main(String[] args) throws ApiException {
        String name = "setSlideShapeInfo.pptx";
        Integer  slideIndex = 0;
        String shapeIndex = "0";
        ShapeBase source = new ShapeBase();
        source.setShapeType(ShapeTypeEnum.RECTANGLE.getValue());
        source.setX(50d);
        source.setY(50d);
        source.setHeight(200d);
        source.setWidth(100d);
        source.setAlternativeText("AlternativeText");
        SolidFill solidFill = new SolidFill("red");
        source.setFillFormat(solidFill);
        source.setZorderPosition(1);
        source.setType("ShapeBase");
        source.setLineFormat(null);
        String password = null;
        String storage = null;
        String folder = "input";
        ShapeBase response = shapesApi.setSlideShapeInfo(name, slideIndex, shapeIndex, source, password, folder, storage);
    }
}

接口方法6:deleteSlideShape()删除形状

HTTP 请求方法:DELETE

请求URL:https://api.e-iceblue.cn/v1/powerpoint/{name}/slides/{slideIndex}/shapes/{shapeIndex}

请求参数:

参数 是否必选 类型 可选值范围 说明
name string   原文档名称
slideIndex integer   幻灯片索引
shapeIndex string   形状索引或形状组的索引
folder string   存放原文档的文件夹,没有则为null
storage string   文档存储空间,使用冰蓝云配置的2G空间存贮文档,可设置为null
password string   原文档密码,没有则为null

Java代码示例:

import spire.cloud.powerpoint.sdk.*;
import spire.cloud.powerpoint.sdk.api.ShapesApi;
import spire.cloud.powerpoint.sdk.model.*;

public class deleteSlideShape {
    static String appId = "your id";
    static String appKey = "your key";
    static String baseUrl = "https://api.e-iceblue.cn";
    static Configuration configuration = new Configuration(appId, appKey, baseUrl);
    static ShapesApi shapesApi = new ShapesApi(configuration);

    public static void main(String[] args) throws ApiException {
        String name = "deleteSlideShape.pptx";
        Integer  slideIndex = 0;
        String shapeIndex = "0";
        String password = null;
        String storage = null;
        String folder = "input";
        Shapes response = shapesApi.deleteSlideShape(name, slideIndex, shapeIndex, password, folder, storage);
    }
}

接口方法7:getSlideShapeParagraphs()获取幻灯片中形状的段落信息

HTTP 请求方法:GET

请求URL:https://api.e-iceblue.cn/v1/powerpoint/{name}/slides/{slideIndex}/shapes/{shapeIndex}/paragraphs

请求参数:

参数 是否必选 类型 可选值范围 说明
name string   原文档名称
slideIndex integer   幻灯片索引
shapeIndex string   形状索引或形状组的索引
folder string   存放原文档的文件夹,没有则为null
storage string   文档存储空间,使用冰蓝云配置的2G空间存贮文档,可设置为null
password string   原文档密码,没有则为null

Java代码示例:

import spire.cloud.powerpoint.sdk.*;
import spire.cloud.powerpoint.sdk.api.ShapesApi;
import spire.cloud.powerpoint.sdk.model.*;

public class getSlideShapeParagraphs {
    static String appId = "your id";
    static String appKey = "your key";
    static String baseUrl = "https://api.e-iceblue.cn";
    static Configuration configuration = new Configuration(appId, appKey, baseUrl);
    static ShapesApi shapesApi = new ShapesApi(configuration);

    public static void main(String[] args) throws ApiException {
        String name = "getSlideShapeParagraphs.pptx";
        Integer  slideIndex = 0;
        String shapeIndex = "0";
        String password = null;
        String storage = null;
        String folder = "input";
        Paragraphs response = shapesApi.getSlideShapeParagraphs(name, slideIndex, shapeIndex, password, folder, storage);
    }
}

接口方法8:addSlideNewParagraph()创建新段落

HTTP 请求方法:POST

请求URL:https://api.e-iceblue.cn/v1/powerpoint/{name}/slides/{slideIndex}/shapes/{shapeIndex}/paragraphs

请求参数:

参数 是否必选 类型 可选值范围 说明
name string   原文档名称
slideIndex integer   幻灯片索引
shapeIndex string   形状索引或形状组的索引
source object { "SelfUri": { "Href": "string", "Relation": "string", "LinkType": "string", "Title": "string" }, "AlternateLinks": [ { "Href": "string", "Relation": "string", "LinkType": "string", "Title": "string" } ], "MarginLeft": 0, "MarginRight": 0, "SpaceBefore": 0, "SpaceAfter": 0, "SpaceWithin": 0, "Indent": 0, "Alignment": "None", "TextAlignment": "None", "DefaultTabSize": 0, "Depth": 0, "BulletChar": "string", "BulletHeight": 0, "BulletType": "None", "NumberedBulletStartWith": 0, "NumberedBulletStyle": "string", "HangingPunctuation": true, "EastAsianLineBreak": true, "LatinLineBreak": true, "RightToLeft": true, "PortionList": [ { "Uri": { "Href": "string", "Relation": "string", "LinkType": "string", "Title": "string" } } ] } 段落的数据传输对象
folder string   存放原文档的文件夹,没有则为null
storage string   文档存储空间,使用冰蓝云配置的2G空间存贮文档,可设置为null
password string   原文档密码,没有则为null
position integer   新段落在集合中的位置,默认是在集合的末尾

Java代码示例:

import spire.cloud.powerpoint.sdk.*;
import spire.cloud.powerpoint.sdk.api.ShapesApi;
import spire.cloud.powerpoint.sdk.model.*;

public class addSlideNewParagraph {
    static String appId = "your id";
    static String appKey = "your key";
    static String baseUrl = "https://api.e-iceblue.cn";
    static Configuration configuration = new Configuration(appId, appKey, baseUrl);
    static ShapesApi shapesApi = new ShapesApi(configuration);

    public static void main(String[] args) throws ApiException {
        String name = "addSlideNewParagraph.pptx";
        Integer  slideIndex = 0;
        String shapeIndex = "0";
        Paragraph source = new Paragraph();
        source.setAlignment(Paragraph.AlignmentEnum.CENTER);
        source.setEastAsianLineBreak(false);
        source.setTextAlignment(Paragraph.TextAlignmentEnum.CENTER);
        source.setMarginLeft(1d);
        source.setMarginRight(5d);
        source.setSpaceAfter(1d);
        source.setSpaceBefore(5d);
        source.setIndent(2d);
        String password = null;
        String storage = null;
        String folder = "input";
        Integer  position = null;
        Paragraph response = shapesApi.addSlideNewParagraph(name, slideIndex, shapeIndex, source, password, folder, storage, position);
    }
}

接口方法9:deleteSlideParagraphs()删除段落

HTTP 请求方法:DELETE

请求URL:https://api.e-iceblue.cn/v1/powerpoint/{name}/slides/{slideIndex}/shapes/{shapeIndex}/paragraphs

请求参数:

参数 是否必选 类型 可选值范围 说明
name string   原文档名称
slideIndex integer   幻灯片索引
shapeIndex string   形状索引或形状组的索引
paragraphs string   要删除的形状的索引,默认删除所有形状
folder string   存放原文档的文件夹,没有则为null
storage string   文档存储空间,使用冰蓝云配置的2G空间存贮文档,可设置为null
password string   原文档密码,没有则为null

Java代码示例:

import spire.cloud.powerpoint.sdk.*;
import spire.cloud.powerpoint.sdk.api.ShapesApi;
import spire.cloud.powerpoint.sdk.model.*;

public class deleteSlideParagraphs {
    static String appId = "your id";
    static String appKey = "your key";
    static String baseUrl = "https://api.e-iceblue.cn";
    static Configuration configuration = new Configuration(appId, appKey, baseUrl);
    static ShapesApi shapesApi = new ShapesApi(configuration);

    public static void main(String[] args) throws ApiException {
        String name = "deleteSlideParagraphs.pptx";
        Integer  slideIndex = 0;
        String shapeIndex = "0";
        String paragraphs = "[0,1]";
        String password = null;
        String storage = null;
        String folder = "input";
        Paragraphs response = shapesApi.deleteSlideParagraphs(name, slideIndex, shapeIndex, paragraphs, password, folder, storage);
    }
}

接口方法10:getSlideShapeParagraph()获取幻灯片中形状的段落信息

HTTP 请求方法:GET

请求URL:https://api.e-iceblue.cn/v1/powerpoint/{name}/slides/{slideIndex}/shapes/{shapeIndex}/paragraphs/{paragraphIndex}

请求参数:

参数 是否必选 类型 可选值范围 说明
name string   原文档名称
slideIndex integer   幻灯片索引
shapeIndex string   形状索引或形状组的索引
ParagraphIndex integer   段落索引
folder string   存放原文档的文件夹,没有则为null
storage string   文档存储空间,使用冰蓝云配置的2G空间存贮文档,可设置为null
password string   原文档密码,没有则为null

Java代码示例:

import spire.cloud.powerpoint.sdk.*;
import spire.cloud.powerpoint.sdk.api.ShapesApi;
import spire.cloud.powerpoint.sdk.model.*;

public class getSlideShapeParagraph {
    static String appId = "your id";
    static String appKey = "your key";
    static String baseUrl = "https://api.e-iceblue.cn";
    static Configuration configuration = new Configuration(appId, appKey, baseUrl);
    static ShapesApi shapesApi = new ShapesApi(configuration);

    public static void main(String[] args) throws ApiException {
        String name = "getSlideShapeParagraph.pptx";
        Integer  slideIndex = 0;
        String shapeIndex = "0";
        Integer  paragraphIndex = 0;
        String password = null;
        String storage = null;
        String folder = "input";
        Paragraph response = shapesApi.getSlideShapeParagraph(name, slideIndex, shapeIndex, paragraphIndex, password, folder, storage);
    }
}

接口方法11:setSlideShapeParagraph()设置段落属性

HTTP 请求方法:PUT

请求URL:https://api.e-iceblue.cn/v1/powerpoint/{name}/slides/{slideIndex}/shapes/{shapeIndex}/paragraphs/{paragraphIndex}

请求参数:

参数 是否必选 类型 可选值范围 说明
name string   原文档名称
slideIndex integer   幻灯片索引
shapeIndex string   形状索引或形状组的索引
paragraphIndex integer   段落索引
source object { "SelfUri": { "Href": "string", "Relation": "string", "LinkType": "string", "Title": "string" }, "AlternateLinks": [ { "Href": "string", "Relation": "string", "LinkType": "string", "Title": "string" } ], "MarginLeft": 0, "MarginRight": 0, "SpaceBefore": 0, "SpaceAfter": 0, "SpaceWithin": 0, "Indent": 0, "Alignment": "None", "TextAlignment": "None", "DefaultTabSize": 0, "Depth": 0, "BulletChar": "string", "BulletHeight": 0, "BulletType": "None", "NumberedBulletStartWith": 0, "NumberedBulletStyle": "string", "HangingPunctuation": true, "EastAsianLineBreak": true, "LatinLineBreak": true, "RightToLeft": true, "PortionList": [ { "Uri": { "Href": "string", "Relation": "string", "LinkType": "string", "Title": "string" } } ] } 段落的数据传输对象
folder string   存放原文档的文件夹,没有则为null
storage string   文档存储空间,使用冰蓝云配置的2G空间存贮文档,可设置为null
password string   原文档密码,没有则为null

Java代码示例:

import spire.cloud.powerpoint.sdk.*;
import spire.cloud.powerpoint.sdk.api.ShapesApi;
import spire.cloud.powerpoint.sdk.model.*;

public class setSlideShapeParagraph {
    static String appId = "your id";
    static String appKey = "your key";
    static String baseUrl = "https://api.e-iceblue.cn";
    static Configuration configuration = new Configuration(appId, appKey, baseUrl);
    static ShapesApi shapesApi = new ShapesApi(configuration);

    public static void main(String[] args) throws ApiException {
        String name = "setSlideShapeParagraph.pptx";
        Integer  slideIndex = 0;
        String shapeIndex = "0";
        Integer  paragraphIndex = 0;
        Paragraph source = new Paragraph();
        source.setMarginLeft(50d);
        source.setTextAlignment(Paragraph.TextAlignmentEnum.TOP);
        source.setAlignment(Paragraph.AlignmentEnum.RIGHT);
        String password = null;
        String storage = null;
        String folder = "input";
        Paragraph response = shapesApi.setSlideShapeParagraph(name, slideIndex, shapeIndex, paragraphIndex, source, password, folder, storage);
    }
}

接口方法12:deleteSlideParagraph()删除段落

HTTP 请求方法:DELETE

请求URL:https://api.e-iceblue.cn/v1/powerpoint/{name}/slides/{slideIndex}/shapes/{shapeIndex}/paragraphs/{paragraphIndex}

请求参数:

参数 是否必选 类型 可选值范围 说明
name string   原文档名称
slideIndex integer   幻灯片索引
shapeIndex string   形状索引或形状组的索引
paragraphIndex integer   段落索引
folder string   存放原文档的文件夹,没有则为null
storage string   文档存储空间,使用冰蓝云配置的2G空间存贮文档,可设置为null
password string   原文档密码,没有则为null

Java代码示例:

import spire.cloud.powerpoint.sdk.*;
import spire.cloud.powerpoint.sdk.api.ShapesApi;
import spire.cloud.powerpoint.sdk.model.*;

public class deleteSlideParagraph {
    static String appId = "your id";
    static String appKey = "your key";
    static String baseUrl = "https://api.e-iceblue.cn";
    static Configuration configuration = new Configuration(appId, appKey, baseUrl);
    static ShapesApi shapesApi = new ShapesApi(configuration);

    public static void main(String[] args) throws ApiException {
        String name = "deleteSlideParagraph.pptx";
        Integer  slideIndex = 0;
        String shapeIndex = "0";
        Integer  paragraphIndex = 0;
        String password = null;
        String storage = null;
        String folder = "input";
        Paragraphs response = shapesApi.deleteSlideParagraph(name, slideIndex, shapeIndex, paragraphIndex, password, folder, storage);
    }
}

接口方法13:getSlideShapeTextRanges()获取段落部分的信息

HTTP 请求方法:GET

请求URL:https://api.e-iceblue.cn/v1/powerpoint/{name}/slides/{slideIndex}/shapes/{shapeIndex}/paragraphs/{paragraphIndex}/portions

请求参数:

参数 是否必选 类型 可选值范围 说明
name string   原文档名称
slideIndex integer   幻灯片索引
shapeIndex string   形状索引或形状组的索引
paragraphIndex integer   段落索引
folder string   存放原文档的文件夹,没有则为null
storage string   文档存储空间,使用冰蓝云配置的2G空间存贮文档,可设置为null
password string   原文档密码,没有则为null

Java代码示例:

import spire.cloud.powerpoint.sdk.*;
import spire.cloud.powerpoint.sdk.api.ShapesApi;
import spire.cloud.powerpoint.sdk.model.*;

public class getSlideShapeTextRanges {
    static String appId = "your id";
    static String appKey = "your key";
    static String baseUrl = "https://api.e-iceblue.cn";
    static Configuration configuration = new Configuration(appId, appKey, baseUrl);
    static ShapesApi shapesApi = new ShapesApi(configuration);

    public static void main(String[] args) throws ApiException {
        String name = "getSlideShapeTextRanges.pptx";
        Integer  slideIndex = 0;
        String shapeIndex = "0";
        Integer  paragraphIndex = 0;
        String password = null;
        String storage = null;
        String folder = "input";
        Portions response = shapesApi.getSlideShapeTextRanges(name, slideIndex, shapeIndex, paragraphIndex, password, folder, storage);
    }
}

接口方法14:addSlideNewTextRange()创建新的段落部分

HTTP 请求方法:POST

请求URL:https://api.e-iceblue.cn/v1/powerpoint/{name}/slides/{slideIndex}/shapes/{shapeIndex}/paragraphs/{paragraphIndex}/portions

请求参数:

参数 是否必选 类型 可选值范围 说明
name string   原文档名称
slideIndex integer   幻灯片索引
shapeIndex string   形状索引或形状组的索引
paragraphIndex integer   段落索引
source object { "SelfUri": { "Href": "string", "Relation": "string", "LinkType": "string", "Title": "string" }, "AlternateLinks": [ { "Href": "string", "Relation": "string", "LinkType": "string", "Title": "string" } ], "Text": "string", "FontBold": true, "FontItalic": true, "FontUnderline": "None", "StrikethroughType": "None", "TextCapType": "None", "Escapement": 0, "Spacing": 0, "FontColor": "string", "HighlightColor": "string", "FontHeight": 0, "NormaliseHeight": true, "ProofDisabled": true, "SmartTagClean": true, "KerningMinimalSize": 0, "Kumimoji": true, "LanguageId": "string", "AlternativeLanguageId": "string", "IsHardUnderlineFill": true, "IsHardUnderlineLine": true, "FillFormat": {}, "EffectFormat": { "Blur": { "Radius": 0, "Grow": true }, "Glow": { "Radius": 0, "Color": "string" }, "InnerShadow": { "Direction": 0, "Distance": 0, "BlurRadius": 0, "ShadowColor": "string" }, "OuterShadow": { "Direction": 0, "Distance": 0, "BlurRadius": 0, "ShadowColor": "string" }, "PresetShadow": { "Direction": 0, "Distance": 0, "Preset": "TopLeftDrop", "ShadowColor": "string" }, "SoftEdge": { "Radius": 0 }, "Reflection": { "Direction": 0, "FadeDirection": 0, "Distance": 0, "BlurRadius": 0, "ScaleHorizontal": 0, "ScaleVertical": 0, "SkewHorizontal": 0, "SkewVertical": 0, "StartPosAlpha": 0, "EndPosAlpha": 0, "StartReflectionOpacity": 0, "EndReflectionOpacity": 0, "RectangleAlign": "None", "RotateShadowWithShape": true }, "FillOverlay": { "Blend": "Darken" } }, "LineFormat": { "Alignment": "None", "CapStyle": "None", "DashStyle": "None", "JoinStyle": "None", "Style": "None", "BeginArrowHead": { "Length": "None", "Style": "UnDefined", "Width": "None" }, "EndArrowHead": { "Length": "None", "Style": "UnDefined", "Width": "None" }, "CustomDashPattern": { "Items": [ 0 ] }, "FillFormat": {}, "MiterLimit": 0, "Width": 0 }, "UnderlineFillFormat": {}, "UnderlineLineFormat": { "Alignment": "None", "CapStyle": "None", "DashStyle": "None", "JoinStyle": "None", "Style": "None", "BeginArrowHead": { "Length": "None", "Style": "UnDefined", "Width": "None" }, "EndArrowHead": { "Length": "None", "Style": "UnDefined", "Width": "None" }, "CustomDashPattern": { "Items": [ 0 ] }, "FillFormat": {}, "MiterLimit": 0, "Width": 0 } } 段落部分的数据传输对象
folder string   存放原文档的文件夹,没有则为null
storage string   文档存储空间,使用冰蓝云配置的2G空间存贮文档,可设置为null
password string   原文档密码,没有则为null
position integer   新段落部分在集合中的位置,默认是在集合末尾

Java代码示例:

import spire.cloud.powerpoint.sdk.*;
import spire.cloud.powerpoint.sdk.api.ShapesApi;
import spire.cloud.powerpoint.sdk.model.*;

public class addSlideNewTextRange {
    static String appId = "your id";
    static String appKey = "your key";
    static String baseUrl = "https://api.e-iceblue.cn";
    static Configuration configuration = new Configuration(appId, appKey, baseUrl);
    static ShapesApi shapesApi = new ShapesApi(configuration);

    public static void main(String[] args) throws ApiException {
        String name = "addSlideNewTextRange.pptx";
        Integer  slideIndex = 0;
        String shapeIndex = "0";
        Integer  paragraphIndex = 0;
        Portion source = new Portion();
        source.setText("add new Text");
        source.setFontBold(true);
        source.setFontColor("blue");
        source.spacing(5d);
        String password = null;
        String storage = null;
        Integer  position = null;
        String folder = "input";
        Portion response = shapesApi.addSlideNewTextRange(name, slideIndex, shapeIndex, paragraphIndex, source, password, folder, storage, position);
    }
}

接口方法15:deleteSlideTextRanges()删除段落部分

HTTP 请求方法:DELETE

请求URL:https://api.e-iceblue.cn/v1/powerpoint/{name}/slides/{slideIndex}/shapes/{shapeIndex}/paragraphs/{paragraphIndex}/portions

请求参数:

参数 是否必选 类型 可选值范围 说明
name string   原文档名称
slideIndex integer   幻灯片索引
shapeIndex string   形状索引或形状组的索引
paragraphIndex integer   段落索引
portions string   需要删除的段落部分的索引,默认删除所有段落
folder string   存放原文档的文件夹,没有则为null
storage string   文档存储空间,使用冰蓝云配置的2G空间存贮文档,可设置为null
password string   原文档密码,没有则为null

Java代码示例:

import spire.cloud.powerpoint.sdk.*;
import spire.cloud.powerpoint.sdk.api.ShapesApi;
import spire.cloud.powerpoint.sdk.model.*;

public class deleteSlideTextRanges {
    static String appId = "your id";
    static String appKey = "your key";
    static String baseUrl = "https://api.e-iceblue.cn";
    static Configuration configuration = new Configuration(appId, appKey, baseUrl);
    static ShapesApi shapesApi = new ShapesApi(configuration);

    public static void main(String[] args) throws ApiException {
        String name = "deleteSlideTextRanges.pptx";
        Integer  slideIndex = 0;
        String shapeIndex = "0";
        Integer  paragraphIndex = 0;
        String portions = "[0,1]";
        String password = null;
        String storage = null;
        String folder = "input";
        Portions response = shapesApi.deleteSlideTextRanges(name, slideIndex, shapeIndex, paragraphIndex, portions, password, folder, storage);
    }
}

接口方法16:getSlideShapeTextRange()获取段落部分的信息

HTTP 请求方法:GET

请求URL:https://api.e-iceblue.cn/v1/powerpoint/{name}/slides/{slideIndex}/shapes/{shapeIndex}/paragraphs/{paragraphIndex}/portions/{portionIndex}

请求参数:

参数 是否必选 类型 可选值范围 说明
name string   原文档名称
slideIndex integer   幻灯片索引
shapeIndex string   形状索引或形状组的索引
paragraphIndex integer   段落索引
portionIndex integer   段落部分的索引
folder string   存放原文档的文件夹,没有则为null
storage string   文档存储空间,使用冰蓝云配置的2G空间存贮文档,可设置为null
password string   原文档密码,没有则为null

Java代码示例:

import spire.cloud.powerpoint.sdk.*;
import spire.cloud.powerpoint.sdk.api.ShapesApi;
import spire.cloud.powerpoint.sdk.model.*;

public class getSlideShapeTextRange {
    static String appId = "your id";
    static String appKey = "your key";
    static String baseUrl = "https://api.e-iceblue.cn";
    static Configuration configuration = new Configuration(appId, appKey, baseUrl);
    static ShapesApi shapesApi = new ShapesApi(configuration);

    public static void main(String[] args) throws ApiException {
        String name = "getSlideShapeTextRange.pptx";
        Integer  slideIndex = 0;
        String shapeIndex = "0";
        Integer  paragraphIndex = 0;
        Integer  portionIndex = 0;
        String password = null;
        String storage = null;
        String folder = "input";
        Portion response = shapesApi.getSlideShapeTextRange(name, slideIndex, shapeIndex, paragraphIndex, portionIndex, password, folder, storage);
    }
}

接口方法17:setParagraphTextRangeProperties()设置段落部分的属性

HTTP 请求方法:PUT

请求URL:https://api.e-iceblue.cn/v1/powerpoint/{name}/slides/{slideIndex}/shapes/{shapeIndex}/paragraphs/{paragraphIndex}/portions/{portionIndex}

请求参数:

参数 是否必选 类型 可选值范围 说明
name string   原文档名称
slideIndex integer   幻灯片索引
shapeIndex string   形状索引或形状组的索引
paragraphIndex integer   段落索引
portionIndex integer   段落部分的索引
source object { "SelfUri": { "Href": "string", "Relation": "string", "LinkType": "string", "Title": "string" }, "AlternateLinks": [ { "Href": "string", "Relation": "string", "LinkType": "string", "Title": "string" } ], "Text": "string", "FontBold": true, "FontItalic": true, "FontUnderline": "None", "StrikethroughType": "None", "TextCapType": "None", "Escapement": 0, "Spacing": 0, "FontColor": "string", "HighlightColor": "string", "FontHeight": 0, "NormaliseHeight": true, "ProofDisabled": true, "SmartTagClean": true, "KerningMinimalSize": 0, "Kumimoji": true, "LanguageId": "string", "AlternativeLanguageId": "string", "IsHardUnderlineFill": true, "IsHardUnderlineLine": true, "FillFormat": {}, "EffectFormat": { "Blur": { "Radius": 0, "Grow": true }, "Glow": { "Radius": 0, "Color": "string" }, "InnerShadow": { "Direction": 0, "Distance": 0, "BlurRadius": 0, "ShadowColor": "string" }, "OuterShadow": { "Direction": 0, "Distance": 0, "BlurRadius": 0, "ShadowColor": "string" }, "PresetShadow": { "Direction": 0, "Distance": 0, "Preset": "TopLeftDrop", "ShadowColor": "string" }, "SoftEdge": { "Radius": 0 }, "Reflection": { "Direction": 0, "FadeDirection": 0, "Distance": 0, "BlurRadius": 0, "ScaleHorizontal": 0, "ScaleVertical": 0, "SkewHorizontal": 0, "SkewVertical": 0, "StartPosAlpha": 0, "EndPosAlpha": 0, "StartReflectionOpacity": 0, "EndReflectionOpacity": 0, "RectangleAlign": "None", "RotateShadowWithShape": true }, "FillOverlay": { "Blend": "Darken" } }, "LineFormat": { "Alignment": "None", "CapStyle": "None", "DashStyle": "None", "JoinStyle": "None", "Style": "None", "BeginArrowHead": { "Length": "None", "Style": "UnDefined", "Width": "None" }, "EndArrowHead": { "Length": "None", "Style": "UnDefined", "Width": "None" }, "CustomDashPattern": { "Items": [ 0 ] }, "FillFormat": {}, "MiterLimit": 0, "Width": 0 }, "UnderlineFillFormat": {}, "UnderlineLineFormat": { "Alignment": "None", "CapStyle": "None", "DashStyle": "None", "JoinStyle": "None", "Style": "None", "BeginArrowHead": { "Length": "None", "Style": "UnDefined", "Width": "None" }, "EndArrowHead": { "Length": "None", "Style": "UnDefined", "Width": "None" }, "CustomDashPattern": { "Items": [ 0 ] }, "FillFormat": {}, "MiterLimit": 0, "Width": 0 } } 段落部分的数据传输对象
folder string   存放原文档的文件夹,没有则为null
storage string   文档存储空间,使用冰蓝云配置的2G空间存贮文档,可设置为null
password string   原文档密码,没有则为null

Java代码示例:

import spire.cloud.powerpoint.sdk.*;
import spire.cloud.powerpoint.sdk.api.ShapesApi;
import spire.cloud.powerpoint.sdk.model.*;

public class setParagraphTextRangeProperties {
    static String appId = "your id";
    static String appKey = "your key";
    static String baseUrl = "https://api.e-iceblue.cn";
    static Configuration configuration = new Configuration(appId, appKey, baseUrl);
    static ShapesApi shapesApi = new ShapesApi(configuration);

    public static void main(String[] args) throws ApiException {
        String name = "shapes.pptx";
        Integer  slideIndex = 0;
        String shapeIndex = "0";
        Integer  paragraphIndex = 0;
        Integer  portionIndex = 0;
        Portion source = new Portion();
        source.setText( "SetParagraphTextRangeProperties");
        source.setFontHeight(20d);
        String password = null;
        String storage = null;
        String folder = "input";
        source.setSpacing(1d);
        source.setFontColor( "blue");
        Portion response = shapesApi.setParagraphTextRangeProperties(name, slideIndex, shapeIndex, paragraphIndex, portionIndex, source, password, folder, storage);
    }
}

接口方法18:deleteSlideTextRange()删除段落部分

HTTP 请求方法:DELETE

请求URL:https://api.e-iceblue.cn/v1/powerpoint/{name}/slides/{slideIndex}/shapes/{shapeIndex}/paragraphs/{paragraphIndex}/portions/{portionIndex}

请求参数:

参数 是否必选 类型 可选值范围 说明
name string   原文档名称
slideIndex integer   幻灯片索引
shapeIndex string   形状索引或形状组的索引
paragraphIndex integer   段落索引
portionIndex integer   段落部分的索引
folder string   存放原文档的文件夹,没有则为null
storage string   文档存储空间,使用冰蓝云配置的2G空间存贮文档,可设置为null
password string   原文档密码,没有则为null

Java代码示例:

import spire.cloud.powerpoint.sdk.*;
import spire.cloud.powerpoint.sdk.api.ShapesApi;
import spire.cloud.powerpoint.sdk.model.*;

public class deleteSlideTextRange {
    static String appId = "your id";
    static String appKey = "your key";
    static String baseUrl = "https://api.e-iceblue.cn";
    static Configuration configuration = new Configuration(appId, appKey, baseUrl);
    static ShapesApi shapesApi = new ShapesApi(configuration);

    public static void main(String[] args) throws ApiException {
        String name = "deleteSlideTextRange.pptx";
        Integer  slideIndex = 0;
        String shapeIndex = "0";
        Integer  paragraphIndex = 0;
        int portionIndex = 0;
        String password = null;
        String storage = null;
        String folder = "input";
        Portions response = shapesApi.deleteSlideTextRange(name, slideIndex, shapeIndex, paragraphIndex, portionIndex, password, folder, storage);
    }
}

接口方法19:saveShapeAs()将形状另存为指定的图片格式

HTTP 请求方法:PUT

请求URL:https://api.e-iceblue.cn/v1/powerpoint/{name}/slides/{slideIndex}/shapes/{shapeIndex}/{format}

请求参数:

参数 是否必选 类型 可选值范围 说明
name string   原文档名称
slideIndex integer   幻灯片索引
shapeIndex string   形状索引或形状组的索引
format string jpg, png, bmp 图片格式
destFilePath string   结果文档的存贮路径,如果省略该参数,则默认存到根目录
folder string   存放原文档的文件夹,没有则为null
storage string   文档存储空间,使用冰蓝云配置的2G空间存贮文档,可设置为null
password string   原文档密码,没有则为null
scaleX number   X轴比例,默认值为0
scaleY number   Y轴比例,默认值为0
bounds integer 0, 1, 2 形状的缩略图边界类型,默认值为1
fontsFolder string   存放字体的文件夹,没有则为null

Java代码示例:

import spire.cloud.powerpoint.sdk.*;
import spire.cloud.powerpoint.sdk.api.ShapesApi;
import spire.cloud.powerpoint.sdk.model.*;

public class saveShapeAs {
    static String appId = "your id";
    static String appKey = "your key";
    static String baseUrl = "https://api.e-iceblue.cn";
    static Configuration configuration = new Configuration(appId, appKey, baseUrl);
    static ShapesApi shapesApi = new ShapesApi(configuration);

    public static void main(String[] args) throws ApiException {
        String name = "saveShapeAs.pptx";
        Integer  slideIndex = 0;
        String shapeIndex = "0";
        String format = "png";
        String destFilePath = "output/saveShapeAs_out.png";
        String password = null;
        String storage = null;
        double scaleX = 1.0;
        double scaleY = 1.0;
        Integer  bounds = null;
        String fontsFolder = null;
        String folder = "input";
        shapesApi.saveShapeAs(name, slideIndex, shapeIndex, format, destFilePath, password, folder, storage, scaleX, scaleY, bounds, fontsFolder);
    }
}