Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Ghostscript for the pdftops filter by default as Poppler's pdftops does not support documents with pages of different sizes #3089

Closed
michaelrsweet opened this Issue Feb 4, 2009 · 5 comments

Comments

Projects
None yet
1 participant
@michaelrsweet
Copy link
Collaborator

michaelrsweet commented Feb 4, 2009

Version: 1.4-feature
CUPS.org User: till.kamppeter

In the last days we have discussed and solved the problem of printing documents which contain pages of different sizes to a printer which has all the needed sizes supplied and having the printer printing each page on the correct paper size.

See the following bug:

http://www.cups.org/str.php?L3063

It works correctly if CUPS 1.4 is built with a Ghostscript-based pdftops filter (HAVE_PDFTOPS not set). With pdftopdf based on Poppler's pdftops (HAVE_PDFTOPS set) all pages get scaled into the size of the first page of the document. This is a problem of Poppler:

http://bugs.freedesktop.org/show_bug.cgi?id=19777

The Poppler developers semm to do not intend to have this functionality in their pdftops tool. A Poppler developer tells in this bug report:

That's more a wish than a bug, in the sense that pdftops was never ment to output different page sizes per page :D (<- probably they mean "per document" here).

So CUPS 1.4 should default to use Ghostscript for doing the conversion from PDF to PostScript.

@michaelrsweet

This comment has been minimized.

Copy link
Collaborator Author

michaelrsweet commented Feb 4, 2009

CUPS.org User: mike

Changing to feature feature for 1.4, as this is not a bug in CUPS.

Given that only the most recent version of Ghostscript even works as a PDF filter, I can't justify making Ghostscript the default. However, I can see changing the "--enable-pdftops" configure option to "--with-pdftops=foo" where "foo" is pdftops, gs, or none. The default will be the same (use pdftops if present) and you can override it with a configure option.

@michaelrsweet

This comment has been minimized.

Copy link
Collaborator Author

michaelrsweet commented Feb 4, 2009

CUPS.org User: till.kamppeter

The best would be to check the version of Ghostscript. If it is 8.64 or newer it should be used by default, otherwise Poppler's pdftops. The possibility to choose manually one of the two by a ./configure option should be always there.

@michaelrsweet

This comment has been minimized.

Copy link
Collaborator Author

michaelrsweet commented Feb 4, 2009

CUPS.org User: mike

Checking the version number output of Ghostscript is non-trivial, since we'd need to convert from floating point to integer to do any comparisons.

The default will still be pdftops, and any Linux distros will need to decide whether they want to use pdftops or gs...

@michaelrsweet

This comment has been minimized.

Copy link
Collaborator Author

michaelrsweet commented Feb 5, 2009

CUPS.org User: mike

Fixed in Subversion repository.

@michaelrsweet

This comment has been minimized.

Copy link
Collaborator Author

michaelrsweet commented Feb 5, 2009

"str3089.patch":

Index: config-scripts/cups-pdf.m4

--- config-scripts/cups-pdf.m4 (revision 8329)
+++ config-scripts/cups-pdf.m4 (working copy)
@@ -13,37 +13,54 @@
dnl file is missing or damaged, see the license at "http://www.cups.org/".
dnl

-AC_ARG_ENABLE(pdftops, [ --enable-pdftops build pdftops filter, default=auto ])
+AC_ARG_WITH(pdftops, [ --with-pdftops=foo set which pdftops filter to use (gs,pdftops,none), default=pdftops ])

PDFTOPS=""
+CUPS_PDFTOPS=""
+CUPS_GHOSTSCRIPT=""

-if test "x$enable_pdftops" != xno; then

  • AC_PATH_PROG(CUPS_PDFTOPS, pdftops)
  • if test "x$CUPS_PDFTOPS" != x; then
  •   AC_DEFINE(HAVE_PDFTOPS)
    
    +case "x$with_pdftops" in
  • x) # Default/auto
  • if test $uname != Darwin; then
  •   AC_PATH_PROG(CUPS_PDFTOPS, pdftops)
    
  •   if test "x$CUPS_PDFTOPS" != x; then
    
  •       AC_DEFINE(HAVE_PDFTOPS)
    
  •       PDFTOPS="pdftops"
    
  •   else
    
  •       AC_PATH_PROG(CUPS_GHOSTSCRIPT, gs)
    
  •       if test "x$CUPS_GHOSTSCRIPT" != x; then
    
  •           AC_DEFINE(HAVE_GHOSTSCRIPT)
    
  •           PDFTOPS="pdftops"
    
  •       fi
    
  •   fi
    
    fi
  • AC_DEFINE_UNQUOTED(CUPS_PDFTOPS, "$CUPS_PDFTOPS")
  • ;;
  • xgs)
    AC_PATH_PROG(CUPS_GHOSTSCRIPT, gs)
    if test "x$CUPS_GHOSTSCRIPT" != x; then
    AC_DEFINE(HAVE_GHOSTSCRIPT)
  •   PDFTOPS="pdftops"
    
  • else
  •   AC_MSG_ERROR(Unable to find gs program!)
    
  •   exit 1
    
    fi
  • AC_DEFINE_UNQUOTED(CUPS_GHOSTSCRIPT, "$CUPS_GHOSTSCRIPT")
  • ;;
  • if test "x$CUPS_PDFTOPS" != x -o "x$CUPS_GHOSTSCRIPT" != x; then
  •   AC_MSG_CHECKING(whether to build pdftops filter)
    
  •   if test x$enable_pdftops = xyes -o $uname != Darwin; then
    
  •       PDFTOPS="pdftops"
    
  •       AC_MSG_RESULT(yes)
    
  •   else
    
  •       AC_MSG_RESULT(no)
    
  •   fi
    
  • elif test x$enable_pdftops = xyes; then
  •   AC_MSG_ERROR(Unable to find pdftops or gs programs!)
    
  • xpdftops)
  • AC_PATH_PROG(CUPS_PDFTOPS, pdftops)
  • if test "x$CUPS_PDFTOPS" != x; then
  •   AC_DEFINE(HAVE_PDFTOPS)
    
  •   PDFTOPS="pdftops"
    
  • else
  •   AC_MSG_ERROR(Unable to find pdftops program!)
    exit 1
    
    fi
    -fi
  • ;;
    +esac

+AC_DEFINE_UNQUOTED(CUPS_PDFTOPS, "$CUPS_PDFTOPS")
+AC_DEFINE_UNQUOTED(CUPS_GHOSTSCRIPT, "$CUPS_GHOSTSCRIPT")
AC_SUBST(PDFTOPS)

dnl

@michaelrsweet michaelrsweet added this to the Stable milestone Mar 17, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.