a2ps-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

html:ps delegation


From: Lourme Alix / Axel
Subject: html:ps delegation
Date: Tue, 17 Sep 2002 15:49:05 +0200

Hi,

It is a patch for hml:ps delegation.
If only netscape is installed -> use netscape
If only html2ps is installed -> use html2ps
If html2ps and netscape are installed -> a2ps test if netscape run and use 
html2ps if not

Now the configure script check if netscape support remote-command.

I have tested with mozilla, mozilla support remote-command but not saveas in ps.

Akim, do you agree with this patch, can I commit ?

Index: ChangeLog
from  Alix Lourme  <address@hidden>

        * etc/a2ps_cfg.in: Add html2ps delegation if netscape don't run.
        * configure.in: Check if netscape and html2ps is installed and
        check if netscape support remote-command.

Index: configure.in
===================================================================
RCS file: /cvsroot/a2ps/a2ps/configure.in,v
retrieving revision 1.2.2.6
diff -u -r1.2.2.6 configure.in
--- configure.in 3 Sep 2002 14:06:29 -0000 1.2.2.6
+++ configure.in 17 Sep 2002 13:40:08 -0000
@@ -297,6 +297,27 @@
 # ImageMagick for most image formats
 ad_CHECK_PROG(convert)
 
+# HTML delegation
+ad_CHECK_PROGS([netscape, html2ps])
+if test "x$COM_netscape" = x; then
+  AC_CACHE_CHECK(whether netscape support remote-command, remote_com_netscape,
+  [$netscape --help >conftest.help 2>&1
+  if fgrep -e -remote  conftest.help >/dev/null &&
+     fgrep -e -noraise conftest.help >/dev/null; then
+     remote_com_netscape=yes
+  else
+     remote_com_netscape=no
+  fi
+  rm -f conftest.help])
+  test "$remote_com_netscape" = no && COM_netscape='#'
+fi
+COM_netscape_test="test -L ${HOME}/.netscape/lock"
+AC_SUBST(COM_netscape_test)
+# If we have netscape and don't have html2ps, we don't test if netscape run
+if test "x$COM_netscape" = x && test "x$COM_html2ps" != x; then
+  COM_netscape_test="true"
+fi
+
 # PDF delegation
 ad_CHECK_PROGS([acroread, pdf2ps])
 COM_acroread4='#'
Index: etc/a2ps_cfg.in
===================================================================
RCS file: /cvsroot/a2ps/a2ps/etc/a2ps_cfg.in,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 a2ps_cfg.in
--- etc/a2ps_cfg.in 4 Mar 2002 18:46:24 -0000 1.1.1.1
+++ etc/a2ps_cfg.in 17 Sep 2002 13:40:08 -0000
@@ -256,6 +256,10 @@
 @COM_PSUTILS@@COM_dvips@   fi
 
 ########## HTML files
+# Delegated to html2ps
address@hidden@@address@hidden: html2ps html:ps \
address@hidden@@COM_html2ps@    html2ps -D -o #f0 '$f' && #{del.psselect} #f0 | 
#{del.psnup}
+# Delegated to Netscape
 # Pass HTML to Netscape, hoping that there is an Netscape running...
 # Tricks:
 # 1. Netscape can't output on stdout, hence use a tmp file (#f0)
@@ -265,15 +269,19 @@
 #    loaded page (not that of openfile).  So run Netscape twice.
 # 4. It asks the user if s/he wants to replace an existing output file,
 #    so rm before.
address@hidden@Delegation: Netscape html:ps    \
address@hidden@  rm -f #f0; \
address@hidden@  if echo '$f' | grep '^/' >/dev/null 2>&1; then \
address@hidden@    ${NETSCAPE:-netscape} -noraise -remote 'openfile($f)'; \
address@hidden@  else \
address@hidden@    ${NETSCAPE:-netscape} -noraise -remote 'openfile(%d/$f)'; \
address@hidden@  fi && \
address@hidden@  ${NETSCAPE:-netscape} -noraise -remote 
'saveas(#f0,postscript)' && \
address@hidden@  #{del.psselect} #f0 | #{del.psnup}
address@hidden@@address@hidden: Netscape html:ps    \
address@hidden@@COM_netscape@  if @COM_netscape_test@; then \
address@hidden@@COM_netscape@    rm -f #f0; \
address@hidden@@COM_netscape@    if echo '$f' | grep '^/' >/dev/null 2>&1; then 
\
address@hidden@@COM_netscape@      ${NETSCAPE:-netscape} -noraise -remote 
'openfile($f)'; \
address@hidden@@COM_netscape@    else \
address@hidden@@COM_netscape@      ${NETSCAPE:-netscape} -noraise -remote 
'openfile(%d/$f)'; \
address@hidden@@COM_netscape@    fi && \
address@hidden@@COM_netscape@    ${NETSCAPE:-netscape} -noraise -remote 
'saveas(#f0,postscript)' && \
address@hidden@@COM_netscape@    #{del.psselect} #f0 | #{del.psnup}; \
address@hidden@@COM_netscape@  else \
address@hidden@@COM_netscape@    html2ps -D -o #f0 '$f' && #{del.psselect} #f0 
| #{del.psnup}; \
address@hidden@@COM_netscape@  fi
 
 ########## PDF files
 # Delegated to pdf2ps, GS 5.10




reply via email to

[Prev in Thread] Current Thread [Next in Thread]