在java摇摆的PDF图象翻译

时间:2015-03-31 03:42:42

标签: java swing pdf jpedal

我正在使用JPedal免费版jar在我的java swing程序中呈现PDF。正常的PDF正在正确呈现,但在渲染PDF图像(图像文件转换为PDF文件)时,质量大幅下降(根本不可读)。

JPedal rendering Image 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});
    }



}

0 个答案:

没有答案