You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by Markus Schlautmann <Tu...@gmx.de> on 2011/05/13 23:19:24 UTC

Usage of PrintPDF

Hi,

i am new to pdfBox and i want to use it to print pdf via command line. i 
am using Windows as my OS.
i downloaded pdfbox-app-1.5.0.jar and tried the following statement:

C:\pdfbox>java pdfbox-app-1.5.0.jar org.apache.pdfbox.PrintPDF 
-silentPrint 200900186.pdf

the pdf is in the same directory as pdfbox-app-1.5.0.jar.

i found this statement here:
http://pdfbox.apache.org/commandlineutilities/PrintPDF.html

Unfortunately it is not working:

C:\pdfbox>java pdfbox-app-1.5.0.jar org.apache.pdfbox.PrintPDF -
silentPrint 200900186.pdf
Exception in thread "main" java.lang.NoClassDefFoundError: 
pdfbox-app-1/5/0/jar
Caused by: java.lang.ClassNotFoundException: pdfbox-app-1.5.0.jar
         at java.net.URLClassLoader$1.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
Could not find the main class: pdfbox-app-1.5.0.jar.  Program will exit.

Could you please give me a hint what goes wrong?

Thanks a lot

Best Regards
Markus

Re: Usage of PrintPDF

Posted by Markus Schlautmann <Tu...@gmx.de>.
Hi,

i found another one:
the -printerName parameter is missing on your website and in the usage 
message for the command printPDF.
I found the parameter in your sourcecode.

Best Regards
Markus

Am 15.05.2011 18:46, schrieb Andreas Lehmkuehler:
> Hi,
>
>
> Am 14.05.2011 13:28, schrieb Markus Schlautmann:
>> Hi Andreas,
>>
>> thx, it is working fine now.
>>
>> i was confused due to different usage messages, the one on your
>> website is
>> different to that one i get on the command line.
>>
>> At least the -jar option is missing in the command line usage message.
>> Could you
>> correct this in a further release too?
> I updated both the online documentation and the command line messages in
> the current trunk, see [1] for further details.
>
>> Best Regards
>> Markus
> Thanks for the pointer.
>
> BR
> Andreas Lehmkühler
>
> [1] https://issues.apache.org/jira/browse/PDFBOX-1012
>

Re: Usage of PrintPDF

Posted by Andreas Lehmkuehler <an...@lehmi.de>.
Hi,


Am 14.05.2011 13:28, schrieb Markus Schlautmann:
> Hi Andreas,
>
> thx, it is working fine now.
>
> i was confused due to different usage messages, the one on your website is
> different to that one i get on the command line.
>
> At least the -jar option is missing in the command line usage message. Could you
> correct this in a further release too?
I updated both the online documentation and the command line messages in the 
current trunk, see [1] for further details.

> Best Regards
> Markus
Thanks for the pointer.

BR
Andreas Lehmkühler

[1] https://issues.apache.org/jira/browse/PDFBOX-1012

Re: Usage of PrintPDF

Posted by Markus Schlautmann <Tu...@gmx.de>.
Hi Andreas,

thx, it is working fine now.

i was confused due to different usage messages, the one on your website 
is different to that one i get on the command line.

At least the -jar option is missing in the command line usage message. 
Could you correct this in a further release too?

Best Regards
Markus

Am 14.05.2011 11:48, schrieb Andreas Lehmkuehler:
> Hi,
>
>
> Am 14.05.2011 10:41, schrieb Markus Schlautmann:
>> Hi,
>>
>> thanks for your tip, bit it is not working for me:
>>
>> C:\pdfbox>java -jar pdfbox-app-1.5.0.jar org.apache.pdfbox.Print
>> PDF -silentPrint 200900186.pdf
>> usage: java pdfbox-app-x.y.z.jar <command> <args..>
>>
>> whats wrong with the usage? i got it from the website, quite confusing...
> Sorry, I didn't check the remaining part of your command line.
>
> It has to be:
>
> java -jar pdfbox-app-1.5.0.jar PrintPDF <command> <args..>
>
> The command line mentioned on our website is obviously wrong. I'll fix
> that later.
>
>> Best Regards
>> Markus
>
>
> BR
> Andreas Lehmkühler
>
>>
>> Am 14.05.2011 10:28, schrieb Andreas Lehmkuehler:
>>> Hi,
>>>
>>> Am 13.05.2011 23:19, schrieb Markus Schlautmann:
>>>> Hi,
>>>>
>>>> i am new to pdfBox and i want to use it to print pdf via command line.
>>>> i am
>>>> using Windows as my OS.
>>>> i downloaded pdfbox-app-1.5.0.jar and tried the following statement:
>>>>
>>>> C:\pdfbox>java pdfbox-app-1.5.0.jar org.apache.pdfbox.PrintPDF
>>>> -silentPrint
>>>> 200900186.pdf
>>>>
>>>> the pdf is in the same directory as pdfbox-app-1.5.0.jar.
>>>>
>>>> i found this statement here:
>>>> http://pdfbox.apache.org/commandlineutilities/PrintPDF.html
>>>>
>>>> Unfortunately it is not working:
>>>>
>>>> C:\pdfbox>java pdfbox-app-1.5.0.jar org.apache.pdfbox.PrintPDF -
>>>> silentPrint 200900186.pdf
>>>> Exception in thread "main" java.lang.NoClassDefFoundError:
>>>> pdfbox-app-1/5/0/jar
>>>> Caused by: java.lang.ClassNotFoundException: pdfbox-app-1.5.0.jar
>>>> at java.net.URLClassLoader$1.run(Unknown Source)
>>>> at java.security.AccessController.doPrivileged(Native Method)
>>>> at java.net.URLClassLoader.findClass(Unknown Source)
>>>> at java.lang.ClassLoader.loadClass(Unknown Source)
>>>> at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
>>>> at java.lang.ClassLoader.loadClass(Unknown Source)
>>>> Could not find the main class: pdfbox-app-1.5.0.jar. Program will exit.
>>>>
>>>> Could you please give me a hint what goes wrong?
>>> You should copy the whole statement. You forgot the "-jar" option ;-)
>>>
>>> java -jar pdfbox-app-1.5.0.jar org.apache.pdfbox.PrintPDF -silentPrint
>>>
>>>
>>>> Thanks a lot
>>>>
>>>> Best Regards
>>>> Markus
>>>
>>> BR
>>> Andreas Lehmkühler
>>>
>
>

Re: Usage of PrintPDF

Posted by Andreas Lehmkuehler <an...@lehmi.de>.
Hi,


Am 14.05.2011 10:41, schrieb Markus Schlautmann:
> Hi,
>
> thanks for your tip, bit it is not working for me:
>
> C:\pdfbox>java -jar pdfbox-app-1.5.0.jar org.apache.pdfbox.Print
> PDF -silentPrint 200900186.pdf
> usage: java pdfbox-app-x.y.z.jar <command> <args..>
>
> whats wrong with the usage? i got it from the website, quite confusing...
Sorry, I didn't check the remaining part of your command line.

It has to be:

java -jar pdfbox-app-1.5.0.jar PrintPDF <command> <args..>

The command line mentioned on our website is obviously wrong. I'll fix that later.

> Best Regards
> Markus


BR
Andreas Lehmkühler

>
> Am 14.05.2011 10:28, schrieb Andreas Lehmkuehler:
>> Hi,
>>
>> Am 13.05.2011 23:19, schrieb Markus Schlautmann:
>>> Hi,
>>>
>>> i am new to pdfBox and i want to use it to print pdf via command line.
>>> i am
>>> using Windows as my OS.
>>> i downloaded pdfbox-app-1.5.0.jar and tried the following statement:
>>>
>>> C:\pdfbox>java pdfbox-app-1.5.0.jar org.apache.pdfbox.PrintPDF
>>> -silentPrint
>>> 200900186.pdf
>>>
>>> the pdf is in the same directory as pdfbox-app-1.5.0.jar.
>>>
>>> i found this statement here:
>>> http://pdfbox.apache.org/commandlineutilities/PrintPDF.html
>>>
>>> Unfortunately it is not working:
>>>
>>> C:\pdfbox>java pdfbox-app-1.5.0.jar org.apache.pdfbox.PrintPDF -
>>> silentPrint 200900186.pdf
>>> Exception in thread "main" java.lang.NoClassDefFoundError:
>>> pdfbox-app-1/5/0/jar
>>> Caused by: java.lang.ClassNotFoundException: pdfbox-app-1.5.0.jar
>>> at java.net.URLClassLoader$1.run(Unknown Source)
>>> at java.security.AccessController.doPrivileged(Native Method)
>>> at java.net.URLClassLoader.findClass(Unknown Source)
>>> at java.lang.ClassLoader.loadClass(Unknown Source)
>>> at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
>>> at java.lang.ClassLoader.loadClass(Unknown Source)
>>> Could not find the main class: pdfbox-app-1.5.0.jar. Program will exit.
>>>
>>> Could you please give me a hint what goes wrong?
>> You should copy the whole statement. You forgot the "-jar" option ;-)
>>
>> java -jar pdfbox-app-1.5.0.jar org.apache.pdfbox.PrintPDF -silentPrint
>>
>>
>>> Thanks a lot
>>>
>>> Best Regards
>>> Markus
>>
>> BR
>> Andreas Lehmkühler
>>


Re: Usage of PrintPDF

Posted by Markus Schlautmann <Tu...@gmx.de>.
Hi,

thanks for your tip, bit it is not working for me:

C:\pdfbox>java -jar pdfbox-app-1.5.0.jar org.apache.pdfbox.Print
PDF -silentPrint 200900186.pdf
usage: java pdfbox-app-x.y.z.jar <command> <args..>

whats wrong with the usage? i got it from the website, quite confusing...

Best Regards
Markus

Am 14.05.2011 10:28, schrieb Andreas Lehmkuehler:
> Hi,
>
> Am 13.05.2011 23:19, schrieb Markus Schlautmann:
>> Hi,
>>
>> i am new to pdfBox and i want to use it to print pdf via command line.
>> i am
>> using Windows as my OS.
>> i downloaded pdfbox-app-1.5.0.jar and tried the following statement:
>>
>> C:\pdfbox>java pdfbox-app-1.5.0.jar org.apache.pdfbox.PrintPDF
>> -silentPrint
>> 200900186.pdf
>>
>> the pdf is in the same directory as pdfbox-app-1.5.0.jar.
>>
>> i found this statement here:
>> http://pdfbox.apache.org/commandlineutilities/PrintPDF.html
>>
>> Unfortunately it is not working:
>>
>> C:\pdfbox>java pdfbox-app-1.5.0.jar org.apache.pdfbox.PrintPDF -
>> silentPrint 200900186.pdf
>> Exception in thread "main" java.lang.NoClassDefFoundError:
>> pdfbox-app-1/5/0/jar
>> Caused by: java.lang.ClassNotFoundException: pdfbox-app-1.5.0.jar
>> at java.net.URLClassLoader$1.run(Unknown Source)
>> at java.security.AccessController.doPrivileged(Native Method)
>> at java.net.URLClassLoader.findClass(Unknown Source)
>> at java.lang.ClassLoader.loadClass(Unknown Source)
>> at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
>> at java.lang.ClassLoader.loadClass(Unknown Source)
>> Could not find the main class: pdfbox-app-1.5.0.jar. Program will exit.
>>
>> Could you please give me a hint what goes wrong?
> You should copy the whole statement. You forgot the "-jar" option ;-)
>
> java -jar pdfbox-app-1.5.0.jar org.apache.pdfbox.PrintPDF -silentPrint
>
>
>> Thanks a lot
>>
>> Best Regards
>> Markus
>
> BR
> Andreas Lehmkühler
>

Re: Usage of PrintPDF

Posted by Andreas Lehmkuehler <an...@lehmi.de>.
Hi,

Am 13.05.2011 23:19, schrieb Markus Schlautmann:
> Hi,
>
> i am new to pdfBox and i want to use it to print pdf via command line. i am
> using Windows as my OS.
> i downloaded pdfbox-app-1.5.0.jar and tried the following statement:
>
> C:\pdfbox>java pdfbox-app-1.5.0.jar org.apache.pdfbox.PrintPDF -silentPrint
> 200900186.pdf
>
> the pdf is in the same directory as pdfbox-app-1.5.0.jar.
>
> i found this statement here:
> http://pdfbox.apache.org/commandlineutilities/PrintPDF.html
>
> Unfortunately it is not working:
>
> C:\pdfbox>java pdfbox-app-1.5.0.jar org.apache.pdfbox.PrintPDF -
> silentPrint 200900186.pdf
> Exception in thread "main" java.lang.NoClassDefFoundError: pdfbox-app-1/5/0/jar
> Caused by: java.lang.ClassNotFoundException: pdfbox-app-1.5.0.jar
> at java.net.URLClassLoader$1.run(Unknown Source)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(Unknown Source)
> at java.lang.ClassLoader.loadClass(Unknown Source)
> at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
> at java.lang.ClassLoader.loadClass(Unknown Source)
> Could not find the main class: pdfbox-app-1.5.0.jar. Program will exit.
>
> Could you please give me a hint what goes wrong?
You should copy the whole statement. You forgot the "-jar" option ;-)

java -jar pdfbox-app-1.5.0.jar org.apache.pdfbox.PrintPDF -silentPrint


> Thanks a lot
>
> Best Regards
> Markus

BR
Andreas Lehmkühler