|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Script works in a Konsole / not as a cron job
Hello,
I'm running FreeBSD 6.2 with KDE 3.5. I wrote a small script that calls acroread to convert a PDF file to a PostScript file. The script works great if I run it in the a KDE Konsole, but if I try to set it up as a cron job I receive the following error. Code:
(acroread:2040): Gtk-WARNING **: cannot open display: Does anyone know any way around this?? Thanks in advance. |
|
#2
|
|||
|
|||
|
Since you are running this as a cron you will need to setup a virtual frame buffer to run the acroread in. Unless you can tell acroread to run headless? Well looking at acroread there is no option for headless.
So you can create a frame buffer by... Code:
Xvfb :1 -screen 1 800x600x16 & So now you have a virtual frame buffer that you can push applications into it. Code:
--screen=<SCREEN>
X screen to use. Use this options to override the screen part of
the DISPLAY environment variable.
acroread -screen :1 [options]
Let me know if this helps!
__________________
-jtalerico Workhorse :: Quad G5 2.5Ghz 8gig's memory 7800GT DDL, 2x 2005FPW's Portable :: MacBook Pro 15" 2gig ram |
|
#3
|
|||
|
|||
|
jtalerico,
Thanks for the reply. Please forgive me if I sound like an idiot. If I issue this command at boot it will create the Virtual Frame Buffer, correct? Code:
Xvfb :1 -screen 1 800x600x16 & When do I use this? And what is <SCREEN> Code:
--screen=<SCREEN> The last part I understand. I'll edit my script using the following. Code:
acroread -screen :1 [options] At this point it isn't working for me because I don't fully understand the code. Thanks for all of you're help. |
|
#4
|
|||
|
|||
|
The SCREEN is the virtual frame buffer you created to push the application to.
You need it here: acroread -screen :1 [options] |
|
#5
|
|||
|
|||
|
This is what I'm typing
[mike@BSD62 ~]$ Xvfb :1 -screen 1 800x600x16 & [mike@BSD62 ~]$ acroread -screen :1 -toPostScript -scale -80 -shrink -optimizeForSpeed ./page1.pdf [mike@BSD62 ~]$ (acroread:801): Gtk-WARNING **: cannot open display: Is --screen=<SCREEN> a command? Where would it go? Thanks for your patience. |
|
#6
|
|||
|
|||
|
I was just showing you what the man page of acroread shows for pushing it to a different screen.
To see what i am talking about do a 'man acroread'. Maybe other versions differ? Sure thing, let me know if you are still having problems getting it started. |
|
#7
|
|||
|
|||
|
Got it working!! Thanks for all of you help
This is what worked. $ Xvfb :1 -screen 0 800x600x16 & $ export DISPLAY=BSD62.1 acroread --screen=1 -toPostScript -scale -80 -shrink -optimizeForSpeed ./page1.pdf Thanks again!! I would have never figured it out without your help. |
|
#8
|
|||
|
|||
|
Glad to see that bit helped!
Looks to be a lot of people on the web trying to automate things with acroread. Maybe post a how-to with what you learned on here. |
![]() |
| Viewing: Dev Shed Forums > Operating Systems > BSD Help > Script works in a Konsole / not as a cron job |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|