Spire.Cloud.SDK for Java提供了PdfImagesApi接口可用于添加图片到PDF文档addImage()、提取PDF中的图片extractImages(),具体操作步骤和Java代码示例可参考以下内容。
一、导入jar文件。(有2种方式)
(推荐)方式1. 创建Maven项目程序,通过仓库下载导入。以IDEA为例,新建Maven项目,在pom.xml文件中配置maven仓库路径,并指定spire.cloud.sdk的依赖,如下:
<repositories> <repository> <id>com.e-iceblue</id> <name>cloud</name> <url></url> </repository> </repositories> <dependencies> <dependency> <groupId> cloud </groupId> <artifactId>spire.cloud.sdk</artifactId> <version>3.5.0</version> </dependency> <dependency> <groupId> com.google.code.gson</groupId> <artifactId>gson</artifactId> <version>2.8.1</version> </dependency> <dependency> <groupId> com.squareup.okhttp</groupId> <artifactId>logging-interceptor</artifactId> <version>2.7.5</version> </dependency> <dependency> <groupId> com.squareup.okhttp </groupId> <artifactId>okhttp</artifactId> <version>2.7.5</version> </dependency> <dependency> <groupId> com.squareup.okio </groupId> <artifactId>okio</artifactId> <version>1.6.0</version> </dependency> <dependency> <groupId> io.gsonfire</groupId> <artifactId>gson-fire</artifactId> <version>1.8.0</version> </dependency> <dependency> <groupId>io.swagger</groupId> <artifactId>swagger-annotations</artifactId> <version>1.5.18</version> </dependency> <dependency> <groupId> org.threeten </groupId> <artifactId>threetenbp</artifactId> <version>1.3.5</version> </dependency> </dependencies>