You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by Charles Givre <cg...@gmail.com> on 2021/12/21 19:32:28 UTC

PDFBox Opening Additional Java Process

Hello there, 
I have a small issue with PDFBox that I'm trying to resolve and could use some assistance.  Here's my use case:  I'm trying to add the capability to Apache Drill to be able to read and query tables contained in PDF files.  I am using pdfbox 2.0.25 and Tabula 1.0.5.  Here's a link to the full pull request: https://github.com/apache/drill/pull/2359

While everything in the code works quite well, when I actually open the file for reading it appears that pdfbox opens an empty Java window.  The only way I've found to prevent this is to add:

System.setProperty("java.awt.headless", "true");

to my code right before the PDDocument is opened.  Unfortunately, my PR will not be accepted with this, so I'm wondering if there is any way to prevent this window from being opened?  Any advice would be greatly appreciated.
Thanks!
-- C
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org


Re: PDFBox Opening Additional Java Process

Posted by Tilman Hausherr <TH...@t-online.de>.
Very mysterious. I searched into the tabula sources for "swing" and 
"awt" and didn't find anything that opens a window.

PDFBox build tests open a window.

Tilman

Am 23.12.2021 um 08:08 schrieb Andreas Lehmkuehler:
> Hi,
>
>
> Am 21.12.21 um 20:32 schrieb Charles Givre:
>> Hello there,
>> I have a small issue with PDFBox that I'm trying to resolve and could 
>> use some assistance.  Here's my use case:  I'm trying to add the 
>> capability to Apache Drill to be able to read and query tables 
>> contained in PDF files.  I am using pdfbox 2.0.25 and Tabula 1.0.5.  
>> Here's a link to the full pull request: 
>> https://github.com/apache/drill/pull/2359
>>
> That's a lot of code and it is hard to find the relevant PDFBox code. 
> It looks like you are using PDFBox to load the PDF and Tabula to do 
> some magic, aren't you?
>
>> While everything in the code works quite well, when I actually open 
>> the file for reading it appears that pdfbox opens an empty Java 
>> window.  The only way I've found to prevent this is to add:
> PDFBox doesn't open any windows as long as you don't use PDFDebugger ;-)
>
>>
>> System.setProperty("java.awt.headless", "true");
>>
>> to my code right before the PDDocument is opened. Unfortunately, my 
>> PR will not be accepted with this, so I'm wondering if there is any 
>> way to prevent this window from being opened?  Any advice would be 
>> greatly appreciated.
> If it is opened BEFORE calling any PDFBox code it likely is some 
> static code executed when loading some classes. But again, PDFBox 
> doesn't do anything like that. Maybe some Tabula code?
>
>
>> Thanks!
>> -- C
>> ---------------------------------------------------------------------
>> 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
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org


Re: PDFBox Opening Additional Java Process

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


Am 21.12.21 um 20:32 schrieb Charles Givre:
> Hello there,
> I have a small issue with PDFBox that I'm trying to resolve and could use some assistance.  Here's my use case:  I'm trying to add the capability to Apache Drill to be able to read and query tables contained in PDF files.  I am using pdfbox 2.0.25 and Tabula 1.0.5.  Here's a link to the full pull request: https://github.com/apache/drill/pull/2359
> 
That's a lot of code and it is hard to find the relevant PDFBox code. It looks 
like you are using PDFBox to load the PDF and Tabula to do some magic, aren't you?

> While everything in the code works quite well, when I actually open the file for reading it appears that pdfbox opens an empty Java window.  The only way I've found to prevent this is to add:
PDFBox doesn't open any windows as long as you don't use PDFDebugger ;-)

> 
> System.setProperty("java.awt.headless", "true");
> 
> to my code right before the PDDocument is opened.  Unfortunately, my PR will not be accepted with this, so I'm wondering if there is any way to prevent this window from being opened?  Any advice would be greatly appreciated.
If it is opened BEFORE calling any PDFBox code it likely is some static code 
executed when loading some classes. But again, PDFBox doesn't do anything like 
that. Maybe some Tabula code?


> Thanks!
> -- C
> ---------------------------------------------------------------------
> 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