You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by Bidouille <oo...@free.fr> on 2019/05/10 07:52:03 UTC
Verbose mode for command-line tools
Hello list,
Is it exist a way to know what data is received by command-line tool?
I run a shell command to PDFBox from OpenOffice and nothing happens.
If I run same line from console, all is fine.
Thanks
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org
Re: Verbose mode for command-line tools
Posted by Tilman Hausherr <TH...@t-online.de>.
Am 14.05.2019 um 19:11 schrieb Andreas Lehmkuehler:
>
> java -jar pdfbox.jar ImageToPDF ImageToPDF ....
👍👍
Re: Verbose mode for command-line tools
Posted by Andreas Lehmkuehler <an...@lehmi.de>.
Am 13.05.19 um 15:00 schrieb Cyril Beaussier:
>
>
> On 2019/05/12 12:39:08, Andreas Lehmkuehler <an...@lehmi.de> wrote:
>> Did you check if OpenOffice uses the same environment as your console,
>> especially w.r.t. to the classpath? Maybe some external jar is missing a
>> OpenOffice simply swallows the exception.
> Well, as I said before: some functions works and others failed.
> I make a testcase. You can see it through a GIF animated:
> https://cjoint.com/c/IEnm6EnidSp
> PDFToImage, ExtractImages and PDFSplit works.
> ExtractText and ImageToPDF are failed.
> I don't understand why.
According to your gif recording you are using something like this
java -jar pdfbox.jar ImageToPDF ImageToPDF ....
I guess the double "ImageToPDF" leads to an exception
Andreas
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> For additional commands, e-mail: users-help@pdfbox.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org
Re: Verbose mode for command-line tools
Posted by Cyril Beaussier <bi...@apache.org>.
Thanks for your job
I will comment in this issue report
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org
Re: Verbose mode for command-line tools
Posted by Tilman Hausherr <TH...@t-online.de>.
Am 23.05.2019 um 15:28 schrieb Cyril Beaussier:
>> Did you see the post by Andreas? And did you correct your script?
> Yes, I fixed the string but the problem still occurs like I said before.
>
Ok, see my comment in
https://issues.apache.org/jira/browse/PDFBOX-4529
Tilman
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org
Re: Verbose mode for command-line tools
Posted by Cyril Beaussier <bi...@apache.org>.
> Did you see the post by Andreas? And did you correct your script?
Yes, I fixed the string but the problem still occurs like I said before.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org
Re: Verbose mode for command-line tools
Posted by Tilman Hausherr <TH...@t-online.de>.
Am 22.05.2019 um 11:23 schrieb Cyril Beaussier:
> New testcase
>
> PDFToImage or ExtractImages or PDFSplit works and generate a logfile
> ExtractText or ImageToPDF still fails and no logfile created
Did you see the post by Andreas? And did you correct your script?
Tilman
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org
Re: Verbose mode for command-line tools
Posted by Cyril Beaussier <bi...@apache.org>.
New testcase
PDFToImage or ExtractImages or PDFSplit works and generate a logfile
ExtractText or ImageToPDF still fails and no logfile created
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org
Re: Verbose mode for command-line tools
Posted by Tilman Hausherr <TH...@t-online.de>.
Am 21.05.2019 um 17:00 schrieb Cyril Beaussier:
> Gotcha! I can generate a log file.
>
> Method ImageToPDF returns 114 lines of:
> may 21, 2019 4:39:37 PM org.apache.pdfbox.pdmodel.font.PDType0Font toUnicode
> WARNING: No Unicode mapping for CID+NN (NN) in font Effra-Light-Identity-H
>
> Hope this help to help me!
Did you miss the post by Andreas? You had "ImageToPDF" twice. And the
log entry you mention wouldn't appear for "ImageToPDF", only for
PDFToImage or ExtractText.
Tilman
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org
Re: Verbose mode for command-line tools
Posted by Cyril Beaussier <bi...@apache.org>.
Gotcha! I can generate a log file.
Method ImageToPDF returns 114 lines of:
may 21, 2019 4:39:37 PM org.apache.pdfbox.pdmodel.font.PDType0Font toUnicode
WARNING: No Unicode mapping for CID+NN (NN) in font Effra-Light-Identity-H
Hope this help to help me!
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org
Re: Verbose mode for command-line tools
Posted by Cyril Beaussier <bi...@apache.org>.
On 2019/05/14 16:50:49, Tilman Hausherr <TH...@t-online.de> wrote:
> To check that the logging works at all, try a command that produces
> logging. To do this, try running PDFToImage with the file from the
> thread "pdfbox parse error "Header doesn't contain versioninfo" here.
Well, I downloaded the PDF from DropBox:
https://www.dropbox.com/s/ic04eojpyhqm2kt/00054_CCH_Annual%20Report_2016-82-85.pdf
But I have not be able to get this error.
Images are been extracted with no problem.
> Other idea: could it be that your call string is too long?
I don't think so because the same strings works perfectly under Windows.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org
Re: Verbose mode for command-line tools
Posted by Tilman Hausherr <TH...@t-online.de>.
To check that the logging works at all, try a command that produces
logging. To do this, try running PDFToImage with the file from the
thread "pdfbox parse error "Header doesn't contain versioninfo" here.
Other idea: could it be that your call string is too long?
Tilman
Am 14.05.2019 um 11:59 schrieb Cyril Beaussier:
> I don't know if I make right things.
> I modify /usr/lib/jvm/lib/logging.properties file with your lines.
> I set java.util.logging.FileHandler.pattern = /home/dude/Public/pdfbox.log
> Now, I run my macro with following string:
> /usr/lib/jvm/bin/java -Djava.util.logging.config.file=logging.properties -jar
> /home/dude/Public/pdfbox.jar ...
> But nothing happens: no pdfbox.log has been created.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> For additional commands, e-mail: users-help@pdfbox.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org
Re: Verbose mode for command-line tools
Posted by Cyril Beaussier <bi...@apache.org>.
I don't know if I make right things.
I modify /usr/lib/jvm/lib/logging.properties file with your lines.
I set java.util.logging.FileHandler.pattern = /home/dude/Public/pdfbox.log
Now, I run my macro with following string:
/usr/lib/jvm/bin/java -Djava.util.logging.config.file=logging.properties -jar
/home/dude/Public/pdfbox.jar ...
But nothing happens: no pdfbox.log has been created.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org
Re: Verbose mode for command-line tools
Posted by Tilman Hausherr <TH...@t-online.de>.
formatting of "logging.properties" got lost, next attempt:
handlers=java.util.logging.FileHandler
java.util.logging.FileHandler.level=FINEST
java.util.logging.FileHandler.pattern=/somepath/pdfbox.log
java.util.logging.FileHandler.formatter=java.util.logging.SimpleFormatter
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org
Re: Verbose mode for command-line tools
Posted by Tilman Hausherr <TH...@t-online.de>.
Am 13.05.2019 um 17:56 schrieb Cyril Beaussier:
>
> On 2019/05/13 13:08:52, Tilman Hausherr <TH...@t-online.de> wrote:
>> I wonder if the "*" could be a problem.
> ExtractText has not this joker in the passed string and this function failed.
> I try to replace * by the fullname image and the problem still occurs.
> :-(
Yeah I know but it was still worth a try.
You could also try to enable logging. add
-Djava.util.logging.config.file=logging.properties
and logging.properties should contain this:
handlers=java.util.logging.FileHandler
java.util.logging.FileHandler.level=FINEST
java.util.logging.FileHandler.pattern=/somepath/pdfbox.log
java.util.logging.FileHandler.formatter=java.util.logging.SimpleFormatter
It would be interesting if there is any output. (No file could also mean
that there were not any messages)
Tilman
Re: AW: Re: Verbose mode for command-line tools
Posted by Cyril Beaussier <bi...@apache.org>.
On 2019/05/13 13:08:52, Tilman Hausherr <TH...@t-online.de> wrote:
> I wonder if the "*" could be a problem.
ExtractText has not this joker in the passed string and this function failed.
I try to replace * by the fullname image and the problem still occurs.
:-(
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org
AW: Re: Verbose mode for command-line tools
Posted by Tilman Hausherr <TH...@t-online.de>.
I wonder if the "*" could be a problem.
Tilman
------------------------------------------------------------------------
Gesendet mit der Telekom Mail App
<https://kommunikationsdienste.t-online.de/redirects/email_app_android_sendmail_footer>
--- Original-Nachricht ---
Von: Cyril Beaussier
Betreff: Re: Verbose mode for command-line tools
Datum: 13.05.2019, 15:00 Uhr
An: users@pdfbox.apache.org
On 2019/05/12 12:39:08, Andreas Lehmkuehler <andreas@lehmi.de
<ma...@lehmi.de> > wrote:
> Did you check if OpenOffice uses the same environment as your console,
> especially w.r.t. to the classpath? Maybe some external jar is missing a
> OpenOffice simply swallows the exception.
Well, as I said before: some functions works and others failed.
I make a testcase. You can see it through a GIF animated:
https://cjoint.com/c/IEnm6EnidSp <https://cjoint.com/c/IEnm6EnidSp>
PDFToImage, ExtractImages and PDFSplit works.
ExtractText and ImageToPDF are failed.
I don't understand why.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
<ma...@pdfbox.apache.org>
For additional commands, e-mail: users-help@pdfbox.apache.org
<ma...@pdfbox.apache.org>
Re: Verbose mode for command-line tools
Posted by Cyril Beaussier <bi...@apache.org>.
On 2019/05/12 12:39:08, Andreas Lehmkuehler <an...@lehmi.de> wrote:
> Did you check if OpenOffice uses the same environment as your console,
> especially w.r.t. to the classpath? Maybe some external jar is missing a
> OpenOffice simply swallows the exception.
Well, as I said before: some functions works and others failed.
I make a testcase. You can see it through a GIF animated:
https://cjoint.com/c/IEnm6EnidSp
PDFToImage, ExtractImages and PDFSplit works.
ExtractText and ImageToPDF are failed.
I don't understand why.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org
Re: Verbose mode for command-line tools
Posted by Andreas Lehmkuehler <an...@lehmi.de>.
Am 10.05.19 um 14:10 schrieb Cyril Beaussier:
> Thanks Tilman for your interrest
>
>> Can you retrieve the standard output / error? And the return code?
> No error is returned by shell command.
> And if I copy / paste the string into console : it works
>
>> - missing permissions in output directory (can you create the target
>> file separately in your macro? Or try running ExtractText with the
>> output file in the same target directory?)
> As said it before
>>> Under OpenOffice, I run my macro with shell command
>>> - PDFToImage : no problem, that works
>>> - ImageToPDF : no output PDF file
>>> Under console, both commands works
> I have an issue only with ImageToPDF and only under OpenOffice.
Did you check if OpenOffice uses the same environment as your console,
especially w.r.t. to the classpath? Maybe some external jar is missing a
OpenOffice simply swallows the exception.
Andreas
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> For additional commands, e-mail: users-help@pdfbox.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org
Re: Verbose mode for command-line tools
Posted by Tilman Hausherr <TH...@t-online.de>.
Am 10.05.2019 um 14:10 schrieb Cyril Beaussier:
> Thanks Tilman for your interrest
>
>> Can you retrieve the standard output / error? And the return code?
> No error is returned by shell command.
> And if I copy / paste the string into console : it works
>
>> - missing permissions in output directory (can you create the target
>> file separately in your macro? Or try running ExtractText with the
>> output file in the same target directory?)
> As said it before
>>> Under OpenOffice, I run my macro with shell command
>>> - PDFToImage : no problem, that works
>>> - ImageToPDF : no output PDF file
>>> Under console, both commands works
> I have an issue only with ImageToPDF and only under OpenOffice.
At this time, all I could offer to you would be to build a version of
the app that does some standard output. I would upload that one to a
sharehoster. Would that be useful? That's why I asked wether you can
catch the standard output / error output. If the output is swallowed by
OpenOffice, then it would be even more difficult.
Tilman
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> For additional commands, e-mail: users-help@pdfbox.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org
Re: Verbose mode for command-line tools
Posted by Cyril Beaussier <bi...@apache.org>.
Thanks Tilman for your interrest
> Can you retrieve the standard output / error? And the return code?
No error is returned by shell command.
And if I copy / paste the string into console : it works
> - missing permissions in output directory (can you create the target
> file separately in your macro? Or try running ExtractText with the
> output file in the same target directory?)
As said it before
>> Under OpenOffice, I run my macro with shell command
>> - PDFToImage : no problem, that works
>> - ImageToPDF : no output PDF file
>> Under console, both commands works
I have an issue only with ImageToPDF and only under OpenOffice.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org
Re: Verbose mode for command-line tools
Posted by Tilman Hausherr <TH...@t-online.de>.
Can you retrieve the standard output / error? And the return code?
Other possible causes of type "dumb but has happened to all of us":
- different versions, i.e. you're running an old version that doesn't
have the feature
- missing permissions in output directory (can you create the target
file separately in your macro? Or try running ExtractText with the
output file in the same target directory?)
- typo in call
- spaces in file name and missing quotes
- permission for macro itself (can any word macro open external files?)
Tilman
Am 10.05.2019 um 12:13 schrieb Cyril Beaussier:
>> You could try the "-time" option of PDFToImage to see if the tool gets
>> called. Or mit "java -version" to see if java gets called at all.
> I use Oracle java 1.8.0_211 on LUbuntu 18.10
> I have PDFbox 3.0.0-SNAPSHOT
> Under OpenOffice, I run my macro with shell command
> - PDFToImage : no problem, that works
> - ImageToPDF : no output PDF file
> Under console, both commands works
>
> I'm lost :-(
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> For additional commands, e-mail: users-help@pdfbox.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org
Re: Verbose mode for command-line tools
Posted by Cyril Beaussier <bi...@apache.org>.
> You could try the "-time" option of PDFToImage to see if the tool gets
> called. Or mit "java -version" to see if java gets called at all.
I use Oracle java 1.8.0_211 on LUbuntu 18.10
I have PDFbox 3.0.0-SNAPSHOT
Under OpenOffice, I run my macro with shell command
- PDFToImage : no problem, that works
- ImageToPDF : no output PDF file
Under console, both commands works
I'm lost :-(
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org
Re: Verbose mode for command-line tools
Posted by Tilman Hausherr <TH...@t-online.de>.
No, there is no such option.
You could try the "-time" option of PDFToImage to see if the tool gets
called. Or mit "java -version" to see if java gets called at all.
Tilman
Am 10.05.2019 um 09:52 schrieb Bidouille:
> Hello list,
>
> Is it exist a way to know what data is received by command-line tool?
>
> I run a shell command to PDFBox from OpenOffice and nothing happens.
> If I run same line from console, all is fine.
>
> Thanks
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> For additional commands, e-mail: users-help@pdfbox.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org