我正在使用JPedal免费版jar在我的java swing程序中呈现PDF。正常的PDF正在正确呈现,但在渲染PDF图像(图像文件转换为PDF文件)时,质量大幅下降(根本不可读)。
示例代码:
public OpenViewer() {
//create and initialise JPedal viewer component
final Viewer myViewer =new Viewer();
myViewer.setupViewer();
//code to open when required
final File file=null; //example is commented out below
final InputStream stream = null;
//open the stream or File
try {
file = new File("/Users/markee/Desktop/myfile.pdf"); // This PDF is converted from tiff
} catch (Exception e) {
e.printStackTrace();
}
if(file!=null) {
myViewer.executeCommand(Commands.OPENFILE, new Object[]{file});
}
}