Imported Upstream version 1.0.14
Didier Raboud
10 years ago
0 | CHANGES.txt - OpenPrinting CUPS Filters v1.0.13 - 2012-04-09 | |
0 | CHANGES.txt - OpenPrinting CUPS Filters v1.0.14 - 2012-04-10 | |
1 | 1 | ------------------------------------------------------------ |
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). | |
2 | 13 | |
3 | 14 | CHANGES IN V1.0.13 |
4 | 15 |
0 | INSTALL - OpenPrinting CUPS Filters v1.0.13 - 2012-04-09 | |
0 | INSTALL - OpenPrinting CUPS Filters v1.0.14 - 2012-04-10 | |
1 | 1 | -------------------------------------------------------- |
2 | 2 | |
3 | 3 | 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 | |
1 | 1 | ------------------------------------------------------- |
2 | 2 | |
3 | 3 | Looking for compile instructions? Read the file "INSTALL.txt" |
19 | 19 | AC_CONFIG_HEADER(config.h) |
20 | 20 | |
21 | 21 | dnl Version number information... |
22 | CUPSFILTERS_VERSION="1.0.13" | |
22 | CUPSFILTERS_VERSION="1.0.14" | |
23 | 23 | AC_SUBST(CUPSFILTERS_VERSION) |
24 | 24 | AC_DEFINE_UNQUOTED(CUPSFILTERS_SVERSION, "cups-filters v$CUPSFILTERS_VERSION") |
25 | 25 |
85 | 85 | AC_MSG_RESULT(no) |
86 | 86 | fi |
87 | 87 | |
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 | ||
88 | 96 | DEFAULT_PDFTOPS="" |
89 | 97 | elif test "x$CUPS_GHOSTSCRIPT" != x; then |
90 | 98 | AC_MSG_CHECKING(whether gs supports the ps2write device) |
117 | 117 | |
118 | 118 | #undef HAVE_PDFTOPS |
119 | 119 | #undef HAVE_PDFTOPS_WITH_ORIGPAGESIZES |
120 | #undef HAVE_PDFTOPS_WITH_RESOLUTION | |
120 | 121 | #define CUPS_PDFTOPS "/usr/bin/pdftops" |
121 | 122 | |
122 | 123 |
2414 | 2414 | ac_config_headers="$ac_config_headers config.h" |
2415 | 2415 | |
2416 | 2416 | |
2417 | CUPSFILTERS_VERSION="1.0.13" | |
2417 | CUPSFILTERS_VERSION="1.0.14" | |
2418 | 2418 | |
2419 | 2419 | cat >>confdefs.h <<_ACEOF |
2420 | 2420 | #define CUPSFILTERS_SVERSION "cups-filters v$CUPSFILTERS_VERSION" |
7228 | 7228 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 |
7229 | 7229 | $as_echo "yes" >&6; } |
7230 | 7230 | $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 | |
7231 | 7243 | |
7232 | 7244 | else |
7233 | 7245 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 |
31 | 31 | #include <string.h> |
32 | 32 | #include <ctype.h> |
33 | 33 | #include <config.h> |
34 | #include <cupsfilters/image-private.h> | |
34 | 35 | |
35 | 36 | #define MAX_CHECK_COMMENT_LINES 20 |
36 | 37 | |
212 | 213 | fit; /* Fit output to default page size? */ |
213 | 214 | ppd_file_t *ppd; /* PPD file */ |
214 | 215 | 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; | |
215 | 222 | cups_file_t *fp; /* Post-processing input file */ |
216 | 223 | int pdf_pid, /* Process ID for pdftops */ |
217 | 224 | pdf_argc, /* Number of args for pdftops */ |
520 | 527 | pdf_argv[pdf_argc++] = (char *)"-origpagesizes"; |
521 | 528 | } |
522 | 529 | #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 */ | |
526 | 565 | pdf_argv[pdf_argc++] = filename; |
527 | 566 | pdf_argv[pdf_argc++] = (char *)"-"; |
528 | 567 | #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); | |
529 | 575 | /* |
530 | 576 | * PostScript debug mode: If you send a job with "lpr -o psdebug" Ghostscript |
531 | 577 | * will not compress the pages, so that the PostScript code can get |