~ubuntu-branches/ubuntu/precise/cups-filters/precise-security

« back to all changes in this revision

Viewing changes to filter/pdftops.c

  • Committer: Package Import Robot
  • Author(s): Till Kamppeter
  • Date: 2012-04-11 22:40:11 UTC
  • mfrom: (1.1.13)
  • Revision ID: package-import@ubuntu.com-20120411224011-cu6yhykq8jmtbcoj
Tags: 1.0.15-0bzr1
* New upstream release
   - pdftops: Suppress image compression only for Brother printers as they
     really need this measure to print at all. This accelerates printer-
     internal job processing on most other printers (tested on HP and
     Kyocera). Also suppress page compression on Kyocera printers, this
     works around a bug in Kyocera's PostScript interpreters which makes
     printing pages with images very slow (LP: #977912).

Show diffs side-by-side

added added

removed removed

Lines of Context:
552
552
  else
553
553
    xres = 300;
554
554
 
 
555
 /*
 
556
  * Reduce the image rendering resolution to make processing of jobs by poth
 
557
  * the PDF->PS converter and the printer faster
 
558
  */
 
559
 /*
 
560
  if (xres % 90 == 0)
 
561
  {
 
562
    if (xres > 360)
 
563
      xres = max(360, xres / 2);
 
564
  }
 
565
  else if (xres % 75 == 0)
 
566
  {
 
567
    if (xres > 300)
 
568
      xres = max(300, xres / 2);
 
569
  }
 
570
  */
 
571
 
555
572
#ifdef HAVE_PDFTOPS
556
573
#ifdef HAVE_PDFTOPS_WITH_RESOLUTION
557
574
 /*
578
595
  * will not compress the pages, so that the PostScript code can get
579
596
  * analysed. This is especially important if a PostScript printer errors or
580
597
  * misbehaves on Ghostscript's output.
 
598
  * On Kyocera printers we always suppress page compression, to avoid slow
 
599
  * processing of raster images.
581
600
  */
582
601
  val = cupsGetOption("psdebug", num_options, options);
583
 
  if (val && strcasecmp(val, "no") && strcasecmp(val, "off") &&
584
 
      strcasecmp(val, "false"))
 
602
  if ((val && strcasecmp(val, "no") && strcasecmp(val, "off") &&
 
603
       strcasecmp(val, "false")) ||
 
604
      (ppd && ppd->manufacturer &&
 
605
       !strncasecmp(ppd->manufacturer, "Kyocera", 7)))
585
606
  {
586
 
    fprintf(stderr, "DEBUG: Deactivated compression of pages in Ghostscript's PostScript output (\"psdebug\" debug mode)\n");
 
607
    fprintf(stderr, "DEBUG: Deactivated compression of pages in Ghostscript's PostScript output (\"psdebug\" debug mode or Kyocera printer)\n");
587
608
    pdf_argv[pdf_argc++] = (char *)"-dCompressPages=false";
588
609
  }
589
610
 /*
590
 
  * The PostScript interpreters on many printers have a bugs which make
 
611
  * The PostScript interpreters on many printers have bugs which make
591
612
  * the interpreter crash, error out, or otherwise misbehave on too
592
613
  * heavily compressed input files, especially if code with compressed
593
 
  * elements is compressed agin. Therefore we reduce compression here.
 
614
  * elements is compressed again. Therefore we reduce compression here.
594
615
  */
595
616
  pdf_argv[pdf_argc++] = (char *)"-dCompressFonts=false";
596
617
  pdf_argv[pdf_argc++] = (char *)"-dNoT3CCITT";
597
 
  pdf_argv[pdf_argc++] = (char *)"-dEncodeMonoImages=false";
598
 
  pdf_argv[pdf_argc++] = (char *)"-dEncodeColorImages=false";
 
618
  if (ppd && ppd->manufacturer &&
 
619
      !strncasecmp(ppd->manufacturer, "Brother", 7))
 
620
  {
 
621
    fprintf(stderr, "DEBUG: Deactivation of Ghostscript's image compression for Brother printers to workarounmd PS interpreter bug\n");
 
622
    pdf_argv[pdf_argc++] = (char *)"-dEncodeMonoImages=false";
 
623
    pdf_argv[pdf_argc++] = (char *)"-dEncodeColorImages=false";
 
624
  }
599
625
  pdf_argv[pdf_argc++] = (char *)"-c";
600
626
  pdf_argv[pdf_argc++] = (char *)"save pop";
601
627
  pdf_argv[pdf_argc++] = (char *)"-f";