Google Groupes n'accepte plus les nouveaux posts ni abonnements Usenet. Les contenus de l'historique resteront visibles.

PDF Processing

4 vues
Accéder directement au premier message non lu

imranbaseer

non lue,
15 nov. 2007, 08:15:0215/11/2007
à
Hi members,
I am PDF Processing...When i tried to execute the following code ,it
thows NULLPOINTER exception...The exception occured at this line System.out.
println(view.getProperty("Default_Zoom_Type"));..... I dont know how to solve
tis.....Please refer the following code and give me the solution for this.....


Thank in advance...

import com.adobe.acrobat.Viewer;
import java.io.*;
public class PdfCheck1{
public static void main(String ar[])throws Exception{
Viewer view = new Viewer();
InputStream input = new FileInputStream("E:\\Imran\\PRO\\PDF\\
ListofPages.
pdf");
view.setDocumentInputStream(input);
System.out.println(view.getPageCount());
System.out.println(view.getProperty("Default_Zoom_Type"));
}
}

with regards,
J.Imran Baseer.

Andrew Thompson

non lue,
15 nov. 2007, 09:30:1915/11/2007
à
imranbaseer wrote:
..

> I am PDF Processing...When i tried to execute the following code ,it
>thows NULLPOINTER exception...

Did you mean a NullPointerException?

If so,
a) Please don't SHOUT at us.
and
b) Please be specific.

Programming is hard. Debugging is harder.
Debugging an application remotely, where the
exceptions and errors are being 'paraphrased' is
even harder again.

Don't make it hard on us (please).

>...The exception occured at this line System.out.
>println(view.getProperty("Default_Zoom_Type"));

I would have guessed that if any property either does not
exist, or is not defined for that PDF file, it returns null.

OTOH, that does not explain the exception, since the output
should simply have been
null
like this line would print..
System.out.println((String)null);

Indeed, the NPE suggests the viewer itself is null, but if
so, the page count could not have been referenced on the
previous line*.

*
> System.out.println(view.getPageCount());

Which leads me to..
Please copy/paste the stacktrace. As well as the
output you are seeing.

--
Andrew Thompson
http://www.athompson.info/andrew/

Message posted via JavaKB.com
http://www.javakb.com/Uwe/Forums.aspx/java-gui/200711/1

Roedy Green

non lue,
15 nov. 2007, 20:20:3915/11/2007
à
On Thu, 15 Nov 2007 13:15:02 GMT, "imranbaseer" <u39085@uwe> wrote,
quoted or indirectly quoted someone who said :

> view.setDocumentInputStream(input);
> System.out.println(view.getPageCount());
> System.out.println(view.getProperty("Default_Zoom_Type"));

I think it unlikely you safely managed to get view.getPageCount() and
then die on view.getProperty.

If view were null, the error would come on view.getPage(Count())
if the property were null, you would simply see the word "null", not a
NullPointerException. Please add some debug code and check the line
number.
--
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com

imranbaseer

non lue,
16 nov. 2007, 05:47:5916/11/2007
à
OUTPUT FOR THAT PROGRAM:::
10
java.lang.NullPointerException
at java.util.Hashtable.put(Unknown Source)
at com.adobe.acrobat.gui.ReaderPrefs.getClientProperties(ReaderPrefs.java:
1063)
at com.adobe.acrobat.Viewer.getProperties(Viewer.java:1191)
at com.adobe.acrobat.Viewer.getProperty(Viewer.java:1186)
at PdfPack.PdfCheck1.main(PdfCheck1.java:112)
Exception in thread "main"

Andrew Thompson wrote:
>...

--

imranbaseer

non lue,
16 nov. 2007, 05:49:2916/11/2007
à
10 is the number of pages of the pdf file.....
nullpointer exception in getproperty() method........

Andrew Thompson wrote:
>...

--

Andrew Thompson

non lue,
16 nov. 2007, 06:04:1916/11/2007
à
imranbaseer wrote:

Please post comments 'in-line' as I do, rather than top-posting them...

>OUTPUT FOR THAT PROGRAM:::

OK. No need to SHOUT!

>>Please copy/paste the stacktrace. As well as the
>>output you are seeing.

>10
>java.lang.NullPointerException
> at java.util.Hashtable.put(Unknown Source)
> at com.adobe.acrobat.gui.ReaderPrefs.getClientProperties(ReaderPrefs.java:
>1063)

Huhh.. That is odd, I thought HashTable was able to
accept 'null' values.

(I am bowing out of this thread, for the moment. Hopefully
one of the Java gurus will spot the problem..)

Message posted via JavaKB.com
http://www.javakb.com/Uwe/Forums.aspx/java-gui/200711/1

imranbaseer

non lue,
16 nov. 2007, 06:16:5016/11/2007
à
hey....coooool......i need answer,tats y i sent mutilple threads... If t s
not possible tell frankly........i tink u r weak n java.....dont waster ur
time with me k....bye....

Andrew Thompson wrote:
>Please post comments 'in-line' as I do, rather than top-posting them...
>
>>OUTPUT FOR THAT PROGRAM:::
>
>OK. No need to SHOUT!
>
>>>Please copy/paste the stacktrace. As well as the
>>>output you are seeing.

>[quoted text clipped - 3 lines]


>> at com.adobe.acrobat.gui.ReaderPrefs.getClientProperties(ReaderPrefs.java:
>>1063)
>
>Huhh.. That is odd, I thought HashTable was able to
>accept 'null' values.
>
>(I am bowing out of this thread, for the moment. Hopefully
>one of the Java gurus will spot the problem..)
>

--

Ed Webb

non lue,
16 nov. 2007, 07:06:4416/11/2007
à
imranbaseer wrote:
> hey....coooool......i need answer,tats y i sent mutilple threads... If t s
> not possible tell frankly........i tink u r weak n java.....dont waster ur
> time with me k....bye....
>

Well good luck figuring it out on your own.

Jeff Higgins

non lue,
16 nov. 2007, 07:59:4216/11/2007
à
haha 1 qwik sear in rt 4um bring ans qwik haha yahoo
"imranbaseer" <u39085@uwe> wrote in message news:7b4bc60bc1aa0@uwe...

Jeff Higgins

non lue,
16 nov. 2007, 08:06:2716/11/2007
à

..bye...


Andrew Thompson

non lue,
16 nov. 2007, 08:20:2816/11/2007
à
imranbaseer wrote:
>....dont waster ur time with me k.

Is that a question? OK, happy to 'comply'.

>...bye....

Bye-bye. *Plonk.*

Message posted via JavaKB.com
http://www.javakb.com/Uwe/Forums.aspx/java-gui/200711/1

Tom N

non lue,
16 nov. 2007, 21:31:4116/11/2007
à
imranbaseer wrote:

> hey....coooool......i need answer,tats y i sent mutilple threads... If
> t s not possible tell frankly........i tink u r weak n java.....dont
> waster ur time with me k....bye....

I think you'll find something helpful here...
http://tinyurl.com/34ugs8

Thomas A. Russ

non lue,
16 nov. 2007, 21:10:0116/11/2007
à
"imranbaseer" <u39085@uwe> writes:

> hey....coooool......i need answer,tats y i sent mutilple threads... If t s
> not possible tell frankly........i tink u r weak n java.....dont waster ur
> time with me k....bye....

Well, then I suggest you hire a consultant to give you those answers.
Posting to a free newsgroup, where the answers you get are from
volunteers, and then complaining about it is just bad manners.

--
Thomas A. Russ, USC/Information Sciences Institute

0 nouveau message