You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by Peng Yu <pe...@gmail.com> on 2020/07/06 00:37:14 UTC
How to suppress warning messages?
Hi,
#!/usr/bin/env python3
import jpype
import jpype.imports
jpype.addClassPath(sys.argv[1])
jpype.startJVM(convertStrings=False)
import org.apache.pdfbox.tools as tools
tools.ExtractText.main(['-startPage', '1', sys.argv[2], sys.argv[3]])
$ ./main.py pdfbox-app-2.0.20.jar in.pdf output.txt
I use the above python program to call pdfbox. But I can get warnings
like this. Is there a way to suppress such warning messages? Thanks.
WARNING: Using fallback font Code2000 for CID-keyed TrueType font ·½ÕýÊéËÎ_GBK
--
Regards,
Peng
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org
Re: How to suppress warning messages?
Posted by Peng Yu <pe...@gmail.com>.
> Create a file named log.properties that has this line:
>
> .level=OFF
>
> and change your command line to:
>
> java -Djava.util.logging.config.file=path/log.properties -jar .....
Thanks.
> I don't know how this translates to your python code.
Can anybody provide the corresponding python code for this? Thanks.
--
Regards,
Peng
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org
Re: How to suppress warning messages?
Posted by Tilman Hausherr <TH...@t-online.de>.
Hi,
Create a file named log.properties that has this line:
.level=OFF
and change your command line to:
java -Djava.util.logging.config.file=path/log.properties -jar .....
I don't know how this translates to your python code. Apparently one can
have extra parameters in startJVM, so try adding
"-Djava.util.logging.config.file=path/log.properties".
When calling java directly, do
|Logger.getLogger("somelogger").||setLevel(Level.OFF);|
Tilman
Am 06.07.2020 um 02:37 schrieb Peng Yu:
> Hi,
>
> #!/usr/bin/env python3
>
> import jpype
> import jpype.imports
> jpype.addClassPath(sys.argv[1])
> jpype.startJVM(convertStrings=False)
> import org.apache.pdfbox.tools as tools
> tools.ExtractText.main(['-startPage', '1', sys.argv[2], sys.argv[3]])
>
> $ ./main.py pdfbox-app-2.0.20.jar in.pdf output.txt
>
> I use the above python program to call pdfbox. But I can get warnings
> like this. Is there a way to suppress such warning messages? Thanks.
>
> WARNING: Using fallback font Code2000 for CID-keyed TrueType font ·½ÕýÊéËÎ_GBK
>