]> git.ipfire.org Git - thirdparty/cups-filters.git/commitdiff
libcupsfilters: cfFilterUniversal() supports also Poppler's pdftops now
authorTill Kamppeter <till.kamppeter@gmail.com>
Fri, 2 Sep 2022 11:24:51 +0000 (13:24 +0200)
committerTill Kamppeter <till.kamppeter@gmail.com>
Fri, 2 Sep 2022 11:24:51 +0000 (13:24 +0200)
Added support for Poppler's pdftops instead of Ghostscript for PDF
rendering by the universal filter function cfFilterUniversal().

By conditional compiling either the filter functions to use
Ghostscript or the ones to use pdftops are used. This can be
controlled via ./configure script, by using the "--disable-..."
argument for the unwished PDF renderer. If both PDF renderers are
enabled, Ghostscript is preferred.

If pdftops is used, the cfFilterUniversal() filter function does not
support PostScript input. For this Ghostscript is required.

If both Ghostscript and pdftops are disabled by ./configure arguments,
the "universal" CUPS filter wrapper is not installed, to not use the
then rather crippled cfFilterUniversal() filter function as CUPS
filter.

Makefile.am
configure.ac
cupsfilters/universal.c

index c3a0ffafd3958edd4f08bb533a032c39058b4878..f43f304161d87092047ed412a37fe8724018da74 100644 (file)
@@ -715,6 +715,8 @@ pkgmime_DATA = \
 
 universalmimefiles = \
        mime/cupsfilters-universal.convs
+universalpsmimefiles = \
+       mime/cupsfilters-universal-postscript.convs
 individualmimefiles = \
        mime/cupsfilters-individual.convs
 popplermimefiles = \
@@ -725,10 +727,9 @@ mutoolmimefiles = \
        mime/cupsfilters-mupdf.convs
 
 if ENABLE_UNIVERSAL_CUPS_FILTER
-if ENABLE_POPPLER
-if ENABLE_GHOSTSCRIPT
 pkgmime_DATA += $(universalmimefiles)
-endif
+if ENABLE_GHOSTSCRIPT
+pkgmime_DATA += $(universalpsmimefiles)
 endif
 endif
 
@@ -755,6 +756,7 @@ endif
 EXTRA_DIST += \
        $(genmimefiles) \
        $(universalmimefiles) \
+       $(universalpsmimefiles) \
        $(individualmimefiles) \
        $(popplermimefiles) \
        $(gsmimefiles) \
@@ -824,13 +826,9 @@ pkgfilter_PROGRAMS += \
        foomatic-rip
 endif
 if ENABLE_UNIVERSAL_CUPS_FILTER
-if ENABLE_POPPLER
-if ENABLE_GHOSTSCRIPT
 pkgfilter_PROGRAMS += \
        universal
 endif
-endif
-endif
 pkgfilter_PROGRAMS += \
        pdftops \
        texttopdf \
index 8f86036f96eb3623a1c3fbc77940bec149222aaf..60f274a0e4520ef857d719d5c084e67e5ff20f18 100644 (file)
@@ -825,12 +825,16 @@ AM_CONDITIONAL([ENABLE_RASTERTOPWG], [test "x$enable_rastertopwg" = "xyes"])
 # ===============================
 AC_ARG_ENABLE([universal-cups-filter],
        [AS_HELP_STRING([--enable-universal-cups-filter], [Use a single, universal CUPS filter executable for all filter functions.])],
-        [enable_universal_cups_filter="$enableval"],
-        [enable_universal_cups_filter=yes]
+       [enable_universal_cups_filter="$enableval"],
+       [enable_universal_cups_filter=yes]
 )
+AS_IF([test "x$CUPS_GHOSTSCRIPT" == "x" -a "x$CUPS_PDFTOPS" == "x"], [
+       enable_universal_cups_filter=no
+])
 AM_CONDITIONAL([ENABLE_UNIVERSAL_CUPS_FILTER],
 [test "x$enable_universal_cups_filter" != "xno"])
 
+
 # =================================
 # Check for individual CUPS filters
 # =================================
index 63d4a68569663a44a462d4728c0e40dec74103eb..144243a4587c4522f49a33ea267a0cd6833e22e8 100644 (file)
@@ -329,8 +329,8 @@ cfFilterUniversal(int inputfd,         /* I - File descriptor input stream */
          goto out;
 #if defined(HAVE_GHOSTSCRIPT) || defined(HAVE_POPPLER_PDFTOPS)
        }
-#endif /* HAVE_GHOSTSCRIPT || HAVE_POPPLER_PDFTOPS */
       }
+#endif /* HAVE_GHOSTSCRIPT || HAVE_POPPLER_PDFTOPS */
     }
   }