itext-questions  

Re: [iText-questions] How to run SelectedPages (from iText-toolbox)headless?

Paulo Soares
Sat, 06 Sep 2008 16:09:11 -0700

The toolbox can't work in headless mode, it still opens windows even in 
command line mode. You can strip the code in SelectedPages.java and create 
your own class, it should take some 20 lines of code.

Paulo

----- Original Message ----- 
From: "Hagabard" <[EMAIL PROTECTED]>
To: <iText-questions@lists.sourceforge.net>
Sent: Saturday, September 06, 2008 10:11 PM
Subject: [iText-questions] How to run SelectedPages (from 
iText-toolbox)headless?


I am not a Java programmer, and I have found the toolbox, and it works
great except I want to use it headless on a server.  All I need is the
SelectedPages plugin from the toolbox.  Is there any way to get this
to work:

java -Djava.awt.headless=true -jar iText-toolbox-2.1.3.jar
SelectedPages tmp_68.pdf 68.pdf 3-7

Without this?

Exception in thread "main" java.awt.HeadlessException
        at 
java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:159)
        at java.awt.Window.<init>(Window.java:407)
        at java.awt.Frame.<init>(Frame.java:402)
        at java.awt.Frame.<init>(Frame.java:367)
        at javax.swing.JFrame.<init>(JFrame.java:163)
        at com.lowagie.toolbox.Toolbox.<init>(Unknown Source)
        at com.lowagie.toolbox.Toolbox.main(Unknown Source)

Do I need to write my own Jar?  Somehow hack the toolbox code?  I
would love to have headless access to the toolbox, no need for a GUI
when you can specify everything on the command line...  SelectedPages
is the only thing I really need, and I would just use pdftk except
that it doesn't run on my platform.

Desktop testing (Linux):
$ java -version
java version "1.6.0_07"
Java(TM) SE Runtime Environment (build 1.6.0_07-b06)
Java HotSpot(TM) Client VM (build 10.0-b23, mixed mode, sharing)

Server deployment (FreeBSD):
$ java -version
java version "1.6.0_07"
Diablo Java(TM) SE Runtime Environment (build 1.6.0_07-b02)
Diablo Java HotSpot(TM) Client VM (build 10.0-b23, mixed mode, sharing)

Thanks in advance for any assistance.



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php