Java: convert PDF to image using ghost4j

守給你的承諾、 提交于 2021-01-29 16:19:13

问题


I am trying to use the ghost4j library to convert a pdf to image. My code looks like this:

import org.ghost4j.document.*;
import org.ghost4j.renderer.*;
import java.util.ArrayList;
import java.util.List;
.
.
.

        PDFDocument document = new PDFDocument();
        document.load(new File("M:\\test.pdf"));
        SimpleRenderer renderer = new SimpleRenderer();
        renderer.setResolution(300);
        List<Image> images = renderer.render(document);

but I get the following error:

error: cannot find symbol List images = renderer.render(document); ^ symbol: class Image location: class ImageRead 1 error

which indicates that compiler cannot find symbol "Image". I'm not sure why?

来源:https://stackoverflow.com/questions/61872881/java-convert-pdf-to-image-using-ghost4j

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!