Login  Register

Re: Opening pdf files in ImageJ

Posted by Michael Schmid on Jul 10, 2009; 8:03pm
URL: http://imagej.273.s1.nabble.com/Opening-pdf-files-in-ImageJ-tp3691811p3691814.html

Hi All,

in the meanwhile I have also found the problem of the PDF_Viewer.java

In public ImagePlus open (String, int, int)
the sequence of commands should be changed:

     decoder.setDefaultDisplayFont("SansSerif");
     if (path.startsWith("http://")) decoder.openPdfFileFromURL(path);
     else decoder.openPdfFile(path);
     decoder.setPageParameters(scale, 1);

The setPageParameters throws a NullPointerException if called before  
the file or URL has been opened.

Michael
________________________________________________________________

On 10 Jul 2009, at 20:48, Michael Schmid wrote:

> Hi all,
>
> this is great!
> But you need a bit more than is obvious at first glance:
>
> The JPedal jar file from
>   http://www.jpedal.org/download/lgpl/jpedal_lgpl.jar
> This should go into the java classpath; on the Macintosh I moved it  
> into /Library/Java/Extensions
>
> The PDF_Viewer from
>   http://pacific.mpi-cbg.de/cgi-bin/gitweb.cgi?
> p=fiji.git;a=blob;f=src-plugins/IO_/io/PDF_Viewer.java;hb=HEAD
>   (Click on "PDF_Viewer.java")
>
> and finally as stated, Extract_Images_From_PDF.java
>   http://pacific.mpi-cbg.de/cgi-bin/gitweb.cgi?
> p=fiji.git;a=blob;f=src-plugins/IO_/io/
> Extract_Images_From_PDF.java;hb=HEAD
>
> Even with everything in folder .../ImageJ/plugins/io, it did not  
> work for me; I had to remove the 'package io' statements from both  
> java files for 'Compile and Run'
>
> Extract_Images_From_PDF works flawlessly.
> PDF_Viewer alone always gives me an Error:  
> java.lang.NullPointerException in the log window (unfortunately  
> without any trace information).
>
> Michael
> ________________________________________________________________
>
> On 10 Jul 2009, at 15:53, Senger Fabrice wrote:
>
>> Mario Faretta a écrit :
>>> Dear all,
>>> is there any way using Imagej to open pdf files?
>>> Thanks for the help
>>> Mario
>>>
>>>
>> http://pacific.mpi-cbg.de/wiki/index.php/Category:Plugins
>>
>> Category E :
>>
>> Extract Images From PDF...
>>
>> Cheers ,
>>
>> Fabrice.
>>
>> --
>> Senger Fabrice
>