0

I am using JPedal free version jar to render PDF in my java swing program. The normal PDF is getting rendered properly but while rendering the PDF image(Image file converted to PDF file) the quality drops considerably(not readable at all).

JPedal rendering Image PDF

Example code :

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});
    }



}
Nesh
  • 134
  • 9
  • What is the preexisting code? – Daniel K. Mar 31 '15 at 03:46
  • I am just setting the JPedal viewer in my InternalFrame and opening the PDF by pdf url . – Nesh Mar 31 '15 at 03:49
  • Consider providing a [runnable example](https://stackoverflow.com/help/mcve) which demonstrates your problem. This is not a code dump, but an example of what you are doing which highlights the problem you are having. This will result in less confusion and better responses – MadProgrammer Mar 31 '15 at 04:04
  • Does that happen for all PDF files with images our just for some? – mkl Mar 31 '15 at 05:35
  • This issue occurs for mostly all image files converted to PDF. In my case, i am using PDF which was converted from .tiff image – Nesh Mar 31 '15 at 05:45
  • Have a look here http://files.idrsolutions.com/samplecode/org/jpedal/examples/images/ConvertPagesToHiResImages.java.html – Lonzak Apr 07 '15 at 09:08

0 Answers0