从 Url 到 Image with Aspose in Java

From Url to Image with Aspose in Java

我正在使用 aspose,特别是 aspose.words,我正在使用它来将 Java/JavaFX 中的文档 (.doc) 转换为 PDF。现在,我想将一个简单的 url: www.google.com 转换为 png,或者通常是图像。这可能吗?

是的,您可以使用 Aspose.Words for Java API 满足此要求。例如,请使用以下代码将网页转换为多页 TIFF 图像:

LoadOptions opts = new LoadOptions();
opts.setLoadFormat(LoadFormat.HTML);
Document doc = new Document("http://www.google.com", opts);
doc.save(getMyDir() + "out.tiff");