先引入对应的依赖
//repository 这个也是放在pom文件目录下,而不是放在settings.xml文件中
<repository>
<id>GroupDocs Artifact Repository</id>
<name>GroupDocs Artifact Repository</name>
<url>https://releases.groupdocs.com/java/repo/</url>
</repository>
//版本不要太新,有bug找不到相对应class,貌似已经被作者进行删除了
<dependency>
<groupId>com.groupdocs</groupId>
<artifactId>groupdocs-conversion</artifactId>
<version>22.11</version>
</dependency>
import com.groupdocs.conversion.Converter;
import com.groupdocs.conversion.filetypes.FileType;
import com.groupdocs.conversion.options.convert.ConvertOptions;
public static void main(String[] args) {
String workDirectory = System.getProperty("user.dir");
// Load source file PS for conversion
Converter converter = new Converter(workDirectory+"\\temp.ps");
// Prepare conversion options for target format PNG
ConvertOptions convertOptions = new FileType().fromExtension("png").getConvertOptions();
// Convert to PNG format
converter.convert(workDirectory+"\\output123.png", convertOptions);
}