Codebase list cups-filters / 58b7893
Imported Upstream version 1.0.14 Didier Raboud 10 years ago
8 changed file(s) with 86 addition(s) and 8 deletion(s). Raw diff Collapse all Expand all
0 CHANGES.txt - OpenPrinting CUPS Filters v1.0.13 - 2012-04-09
0 CHANGES.txt - OpenPrinting CUPS Filters v1.0.14 - 2012-04-10
11 ------------------------------------------------------------
2
3 CHANGES IN V1.0.14
4
5 - pdftops: Determine printing resolution from the PPD file and supply
6 it on the Ghostscript or pdftops (Poppler) command line, so that
7 the renderer does the image rendering with a resolution matching the
8 printer's resolution. This avoids too slow processing of the jobs
9 by the printer's built-in PostScript interpreter. In addition
10 a default resolution of 300 dpi is used for PPDs without any hint
11 of the printer's resolution, as most PostScript lasers use multiples
12 of 300 dpi as resolution (Ubuntu bug #977912).
213
314 CHANGES IN V1.0.13
415
0 INSTALL - OpenPrinting CUPS Filters v1.0.13 - 2012-04-09
0 INSTALL - OpenPrinting CUPS Filters v1.0.14 - 2012-04-10
11 --------------------------------------------------------
22
33 This file describes how to compile and install OpenPrinting CUPS
0 README - OpenPrinting CUPS Filters v1.0.13 - 2012-04-09
0 README - OpenPrinting CUPS Filters v1.0.14 - 2012-04-10
11 -------------------------------------------------------
22
33 Looking for compile instructions? Read the file "INSTALL.txt"
1919 AC_CONFIG_HEADER(config.h)
2020
2121 dnl Version number information...
22 CUPSFILTERS_VERSION="1.0.13"
22 CUPSFILTERS_VERSION="1.0.14"
2323 AC_SUBST(CUPSFILTERS_VERSION)
2424 AC_DEFINE_UNQUOTED(CUPSFILTERS_SVERSION, "cups-filters v$CUPSFILTERS_VERSION")
2525
8585 AC_MSG_RESULT(no)
8686 fi
8787
88 AC_MSG_CHECKING(whether pdftops supports -r)
89 if ($CUPS_PDFTOPS -h 2>&1 | grep -q -- '-r '); then
90 AC_MSG_RESULT(yes)
91 AC_DEFINE(HAVE_PDFTOPS_WITH_RESOLUTION)
92 else
93 AC_MSG_RESULT(no)
94 fi
95
8896 DEFAULT_PDFTOPS=""
8997 elif test "x$CUPS_GHOSTSCRIPT" != x; then
9098 AC_MSG_CHECKING(whether gs supports the ps2write device)
117117
118118 #undef HAVE_PDFTOPS
119119 #undef HAVE_PDFTOPS_WITH_ORIGPAGESIZES
120 #undef HAVE_PDFTOPS_WITH_RESOLUTION
120121 #define CUPS_PDFTOPS "/usr/bin/pdftops"
121122
122123
24142414 ac_config_headers="$ac_config_headers config.h"
24152415
24162416
2417 CUPSFILTERS_VERSION="1.0.13"
2417 CUPSFILTERS_VERSION="1.0.14"
24182418
24192419 cat >>confdefs.h <<_ACEOF
24202420 #define CUPSFILTERS_SVERSION "cups-filters v$CUPSFILTERS_VERSION"
72287228 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
72297229 $as_echo "yes" >&6; }
72307230 $as_echo "#define HAVE_PDFTOPS_WITH_ORIGPAGESIZES 1" >>confdefs.h
7231
7232 else
7233 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7234 $as_echo "no" >&6; }
7235 fi
7236
7237 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pdftops supports -r" >&5
7238 $as_echo_n "checking whether pdftops supports -r... " >&6; }
7239 if ($CUPS_PDFTOPS -h 2>&1 | grep -q -- '-r '); then
7240 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
7241 $as_echo "yes" >&6; }
7242 $as_echo "#define HAVE_PDFTOPS_WITH_RESOLUTION 1" >>confdefs.h
72317243
72327244 else
72337245 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3131 #include <string.h>
3232 #include <ctype.h>
3333 #include <config.h>
34 #include <cupsfilters/image-private.h>
3435
3536 #define MAX_CHECK_COMMENT_LINES 20
3637
212213 fit; /* Fit output to default page size? */
213214 ppd_file_t *ppd; /* PPD file */
214215 ppd_size_t *size; /* Current page size */
216 char resolution[128] = "300";/* Output resolution */
217 int xres = 0, yres = 0, /* resolution values */
218 numvalues; /* Number of values actually read */
219 ppd_choice_t *choice;
220 ppd_attr_t *attr;
221 cups_page_header2_t header;
215222 cups_file_t *fp; /* Post-processing input file */
216223 int pdf_pid, /* Process ID for pdftops */
217224 pdf_argc, /* Number of args for pdftops */
520527 pdf_argv[pdf_argc++] = (char *)"-origpagesizes";
521528 }
522529 #endif /* HAVE_PDFTOPS && HAVE_PDFTOPS_WITH_ORIGPAGESIZES */
523 }
524
525 #ifdef HAVE_PDFTOPS
530
531 /*
532 * Set output resolution ...
533 */
534
535 if ((choice = ppdFindMarkedChoice(ppd, "Resolution")) != NULL)
536 strncpy(resolution, choice->choice, sizeof(resolution));
537 else if ((attr = ppdFindAttr(ppd,"DefaultResolution",NULL)) != NULL)
538 strncpy(resolution, attr->value, sizeof(resolution));
539 else if (cupsRasterInterpretPPD(&header, ppd, num_options, options, NULL) == 0)
540 {
541 xres = header.HWResolution[0];
542 yres = header.HWResolution[1];
543 }
544 }
545
546 if ((xres > 0) || (yres > 0) ||
547 ((numvalues = sscanf(resolution, "%dx%d", &xres, &yres)) > 0))
548 {
549 if ((yres > 0) && (xres > yres)) xres = yres;
550 }
551 else
552 xres = 300;
553
554 #ifdef HAVE_PDFTOPS
555 #ifdef HAVE_PDFTOPS_WITH_RESOLUTION
556 /*
557 * Set resolution to avoid slow processing by the printer when the resolution
558 * of embedded images does not match the printer' s resolution
559 */
560 pdf_argv[pdf_argc++] = (char *)"-r";
561 snprintf(resolution, sizeof(resolution), "%d", xres);
562 pdf_argv[pdf_argc++] = resolution;
563 fprintf(stderr, "DEBUG: Using image rendering resolution %d dpi\n", xres);
564 #endif /* HAVE_PDFTOPS_WITH_RESOLUTION */
526565 pdf_argv[pdf_argc++] = filename;
527566 pdf_argv[pdf_argc++] = (char *)"-";
528567 #else
568 /*
569 * Set resolution to avoid slow processing by the printer when the resolution
570 * of embedded images does not match the printer' s resolution
571 */
572 snprintf(resolution, 127, "-r%d", xres);
573 pdf_argv[pdf_argc++] = resolution;
574 fprintf(stderr, "DEBUG: Using image rendering resolution %d dpi\n", xres);
529575 /*
530576 * PostScript debug mode: If you send a job with "lpr -o psdebug" Ghostscript
531577 * will not compress the pages, so that the PostScript code can get