You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by stephen smith <sm...@hotmail.com> on 2011/07/15 18:25:11 UTC

PDF prints on local, on server gives HeadlessException

Hello,
 
I am printina pdf using PDFBox. It works great on out local dev boxes but when we move to the server it gives the error:
java.awt.HeadlessException
at sun.print.PSPrinterJob.printDialog(PSPrinterJob.java:401)
     at org.pdfbox.pdmodel.PDDocument.print(PDDocument.java:831)...
 
Can anyone help with this?
 
Thanks
 		 	   		  

Re: PDF prints on local, on server gives HeadlessException

Posted by Ken Bowen <ke...@form-runner.com>.
Well, that's the limit of my knowledge.  Hopefully there's someone else on the list with more specific knowledge.
However, since the error appears to be thrown from the printer software  
	sun.print.PSPrinterJob.printDialog(PSPrinterJob.java:401)
you might want to check the documentation there to be sure it is getting the info about running headless.

--Ken


On Jul 15, 2011, at 3:39 PM, stephen smith wrote:

> 
> Thanks!
> 
> Yes we have done that. I also test to see that Headless == true before I print, and it does. We still get the error.
> 
> Any ideas?
> 
> Thanks
> 
> 
> 
> 
>> Subject: Re: PDF prints on local, on server gives HeadlessException
>> From: ken@form-runner.com
>> Date: Fri, 15 Jul 2011 14:41:53 -0400
>> To: users@pdfbox.apache.org
>> 
>> Almost certainly you need to run in Headless mode. Check out:
>> 
>> http://java.sun.com/developer/technicalArticles/J2SE/Desktop/headless/
>> 
>> --Ken
>> On Jul 15, 2011, at 12:25 PM, stephen smith wrote:
>> 
>>> 
>>> Hello,
>>> 
>>> I am printina pdf using PDFBox. It works great on out local dev boxes but when we move to the server it gives the error:
>>> java.awt.HeadlessException
>>> at sun.print.PSPrinterJob.printDialog(PSPrinterJob.java:401)
>>> at org.pdfbox.pdmodel.PDDocument.print(PDDocument.java:831)...
>>> 
>>> Can anyone help with this?
>>> 
>>> Thanks
>>> 
>> 
> 		 	   		  


RE: PDF prints on local, on server gives HeadlessException

Posted by stephen smith <sm...@hotmail.com>.
Thanks!

Yes we have done that. I also test to see that Headless == true before I print, and it does. We still get the error.
 
Any ideas?
 
Thanks
 

 

> Subject: Re: PDF prints on local, on server gives HeadlessException
> From: ken@form-runner.com
> Date: Fri, 15 Jul 2011 14:41:53 -0400
> To: users@pdfbox.apache.org
> 
> Almost certainly you need to run in Headless mode. Check out:
> 
> http://java.sun.com/developer/technicalArticles/J2SE/Desktop/headless/
> 
> --Ken
> On Jul 15, 2011, at 12:25 PM, stephen smith wrote:
> 
> > 
> > Hello,
> > 
> > I am printina pdf using PDFBox. It works great on out local dev boxes but when we move to the server it gives the error:
> > java.awt.HeadlessException
> > at sun.print.PSPrinterJob.printDialog(PSPrinterJob.java:401)
> > at org.pdfbox.pdmodel.PDDocument.print(PDDocument.java:831)...
> > 
> > Can anyone help with this?
> > 
> > Thanks
> > 
> 
 		 	   		  

Re: PDF prints on local, on server gives HeadlessException

Posted by Ken Bowen <ke...@form-runner.com>.
Almost certainly you need to run in Headless mode.  Check out:

http://java.sun.com/developer/technicalArticles/J2SE/Desktop/headless/

--Ken
On Jul 15, 2011, at 12:25 PM, stephen smith wrote:

> 
> Hello,
> 
> I am printina pdf using PDFBox. It works great on out local dev boxes but when we move to the server it gives the error:
> java.awt.HeadlessException
> at sun.print.PSPrinterJob.printDialog(PSPrinterJob.java:401)
>     at org.pdfbox.pdmodel.PDDocument.print(PDDocument.java:831)...
> 
> Can anyone help with this?
> 
> Thanks
>