Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/image/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在Java中使用Aspose从Url到图像_Java_Image_Url_Aspose.words - Fatal编程技术网

在Java中使用Aspose从Url到图像

在Java中使用Aspose从Url到图像,java,image,url,aspose.words,Java,Image,Url,Aspose.words,我使用的是aspose,特别是aspose.words,我使用它在Java/JavaFX中将文档(.doc)转换为PDF。现在,我想将一个简单的url:例如,www.google.com转换成png,或者通常是图像。这可能吗?是的,您可以使用满足此要求。请使用以下代码将网页转换为多页TIFF图像,例如: LoadOptions opts = new LoadOptions(); opts.setLoadFormat(LoadFormat.HTML); Document doc = new Doc

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

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

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